Question #92973

What will be printed because of the following code?

int x=5;
double xx=5;
cout << 1/2*x << endl;
cout << 1/2*xx << endl;
cout << x/2 << endl;
cout << xx/2 << endl;

Note- ignore newline (endl) while answering.

Expert's answer

It will be printed (without new line as question recommends):

0 0 2 2.5


LATEST TUTORIALS
APPROVED BY CLIENTS