Answer on Question#37831- Programming, C++
1. What will be the value of i for the following expression :
int f=11, i=3;
i+=(f>3) ? i & 2:5;
Solution.
#include <iostream>
using namespace std;
int main()
{
int f=11, i=3;
i+=(f>3) ? i & 2:5;
cout<<i;
system("pause");
return 0;
}
i=5

Comments