Member • Nov 9, 2006
'C' code
cout<<"g="<
what would be the value of g? If you think the answer is you got is correct
Justify your answer.
Member • Nov 9, 2006
Member • Nov 9, 2006
I'm not a C coder, but g = 109.223 😉ravibharadwajint g=300*300/300;
cout<<"g="<<g;
what would be the value of g? If you think the answer is you got is correct
Justify your answer.
Member • Nov 9, 2006
Member • Nov 10, 2006
Member • Nov 10, 2006
Sahan's explanation is better. I think the answer is 81. ravibharadwaj please post the correct answer.sahanathe answer will be 81.
300*300/300
first 300*300 will be computed which is 90000.this is greater than 32767 which is the limit of data type int.hence 90000%32767 will be calculated which is 24466.now this will be divided with 300 (as the expression is 300*300/300). hence the answer is 81.
Member • Nov 12, 2006
Member • Nov 12, 2006
Is that the right answer though? Please confirm. I think 81 is the right answer.ravibharadwajGood one sahana and crook. Keep up the good work.
post in more puzzels
Member • Nov 18, 2006
Member • Sep 30, 2010
Member • Dec 26, 2015
Member • Jan 4, 2016