Answer to Question #102626 in C++ for Jitendra Chouhan

Question #102626
What will be printed because of the following code

int x=5;
double xx=5;
cout << 1/2*x << endl; // OUTPUT1
cout << 1/2*xx << endl; // OUTPUT2
cout << x/2 << endl; // OUTPUT3
cout << xx/2 << endl; // OUTPUT4
1
Expert's answer
2020-02-09T09:31:41-0500



OUTPUT1: 0

OUTPUT2: 0

OUTPUT3: 2

OUTPUT4: 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