I don't quite understand the output, which is 1.
At the line, i=fun(1) || fun(2); , why does i equal to 1?
fun(1) returns 2
fun(2) returns 4
can someone explain the step by step process of the code? please help
1 2 3 4 5 6 7 8 9 10 11 12 13
#include <iostream>
usingnamespace std;
int fun(int x) {
return 2*x;
}
int main() {
int i;
i = fun(1)||fun(2);
cout << i;
return 0;
}