0

int a =10 int b = 2 a*=b cout << a/ ++b What is the output? And how do you derive it? Appreciate the help! Thanks!

Some simple arithmetic Pls Help

29th Sep 2016, 9:30 AM
chittychitty15
chittychitty15 - avatar
9 ответов
+ 1
a*=b ; will give a the value 20. 20/3 is ans
29th Sep 2016, 9:39 AM
Hitesh Datt
Hitesh Datt - avatar
+ 1
Thanks for the quick reply!
29th Sep 2016, 9:42 AM
chittychitty15
chittychitty15 - avatar
+ 1
yury means that if the whole function is set to return value in int(integer) type then output is 6 and if it is set to return in double(used for fraction number) then output is 6.666... the output is never 20/3 it always the final calculation which is being output
29th Sep 2016, 10:12 AM
Hitesh Datt
Hitesh Datt - avatar
0
Oops haha my bad, just edited, pls look again :)
29th Sep 2016, 9:36 AM
chittychitty15
chittychitty15 - avatar
0
if int main... then answer 6 if double main.. then answer 6.666..
29th Sep 2016, 9:47 AM
Yury Tulinoff
Yury Tulinoff - avatar
0
+Yurt Tulinoff Can you explain more? I'm not very sure what you meant?
29th Sep 2016, 9:50 AM
chittychitty15
chittychitty15 - avatar
0
just 6.
29th Sep 2016, 2:38 PM
kiwiyou
kiwiyou - avatar
- 1
+bb doesn't mean anything!!
29th Sep 2016, 9:34 AM
Hitesh Datt
Hitesh Datt - avatar
- 1
Don't worry if u are still wondering what does that mean.... U'll get to know about it.
29th Sep 2016, 10:16 AM
Hitesh Datt
Hitesh Datt - avatar