Please do help me out with these questions
1. How do we get the o/p as 2 when the initialization is 3
2. What does caret '^' represents in C++ ?
11 ^ 5 shows the output as 14 !?
3. Can we do assignment under conditional statements as in if else ? if(x=(a-b) ?
More to come.
Please do help.
1. How do we get the o/p as 2 when the initialization is 3
Code:
int main()
{ int x = 3;
if( x == 2 );
x = 0;
if( x == 3 )
x++;
else x += 2;
cout<< x;
}
2. What does caret '^' represents in C++ ?
11 ^ 5 shows the output as 14 !?
3. Can we do assignment under conditional statements as in if else ? if(x=(a-b) ?
More to come.
Please do help.