What will be output if you will execute following c code?

Code
  1.  #i ain()

  2. "%f"
Copyright GeekInterview.com

a) 1.000000
b) 0.333333
c) -2.333333
d) 1

Questions by lalithakasiraj

Showing Answers 1 - 3 of 3 Answers

bavya

  • Feb 15th, 2013
 

avg(1,-6,-2)/3 =-2.3333

  Was this answer useful?  Yes

Howard Lee Harkness

  • Apr 4th, 2013
 

The real answer is that any programmer who would write this kind of code should be given the opportunity to work for the competition.

The sequence expression (q=4,r=-12,q) evaluates to 4 (the last element), with the side-effect of assigning r the value -12. So, avg(1,4,-12) = -7/3 = -2.33...

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions