Discussion :: C++ - MCQs
-
What is the output of this program?
#include < iostream >
using namespace std;
int main()
{
int i, j;
j = 10;
i = (j++, j + 100, 999 + j);
cout << i;
return 0;
}
Answer : Option C
Explanation :
j starts with the value 10. j is then incremented to 11. Next, j is added to 100. Finally, j (still containing 11) is added to 999 which yields the result 1010.
Be The First To Comment