void main()
{
int a=1;
printf("%d %d %d",a,++a,a++);
}
the output is supposed to be 1 2 2....but it is 3 3 1
this is due to calling conventions of C. if anyone can
explain me how it happens?

Answer Posted / hemanth

All,

output of above code is compiler depended i.e the order of
evalulation.

Is This Answer Correct ?    8 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the collection of communication lines and routers called?

614


What is c basic?

602


Why do we use main function?

638


What would happen to X in this expression: X += 15; (assuming the value of X is 5)

1306


Explain what standard functions are available to manipulate strings?

613






How to write a code for implementing my own printf() and scanf().... Please hep me in this... I need a guidance... Can you give an coding for c... Please also explain about the header files used other than #include...

4906


formula to convert 2500mmh2o into m3/hr

499


List some applications of c programming language?

553


praagnovation

1780


Is c easy to learn?

562


Differentiate between a for loop and a while loop? What are it uses?

676


Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff

2243


What is scanf () in c?

665


When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.

1531


Can a function argument have default value?

675