Question #146568

For each line of code given below, what would be displayed on the screen:
1) cout << 1 / 2 << " " << 1 / (double) 2 << ' ' << 1 / 2 * 1.0 << ' ' << 1.0 * 1 / 2;
2) cout << (char) 65.5;
3) cout << (char) 65 + 1;
4) cout << (char) 65 + (char) 1;
5) cout << 'A' + 'B';
6) cout << (char) (65 + 1);

Expert's answer

1) 0 0.5 0 0.5
2) A
3) 66
4) 66
5) 131
6) B

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS