Answer to Question #92973 in C++ for Shivaprasad

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.
1
Expert's answer
2019-08-21T05:20:23-0400

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

0 0 2 2.5


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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS