main()
{
int i = 10;
printf(" %d %d %d \n", ++i, i++, ++i);
}

Answer Posted / dr. sanyasi naidu pasala

13 11 11
First the value of i was assigned to right most variable ++i. In this first i value which is 10 will be incremented to 11, then assigned to i and printed as 11. Then that 11 is passed to the middle variable which is i++. In this first the value 11 is assigned to i, print the value of i as 11 and then incremented to 12. This 12 is now passed to left most variable ++i. In this the value 12 is first incremented to 13 then assigned to i and print as 13. Even though generally the evaluation will be taken place from right most variable to left most variable, the evaluation process may vary from operating system to operating system.

Is This Answer Correct ?    27 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??

1737


When can you use a pointer with a function?

736


How would you use the functions fseek(), freed(), fwrite() and ftell()?

898


Why do we use null pointer?

775


What is difference between constant pointer and constant variable?

891


Write a program to know whether the input number is an armstrong number.

883


What are the types of variables in c?

754


Why calloc is better than malloc?

776


Can you write the function prototype, definition and mention the other requirements.

864


what is the height of tree if leaf node is at level 3. please explain

1820


What is array of structure in c programming?

981


write a c program in such a way that if we enter the today date the output should be next day's date.

1899


Where are some collections of useful code fragments and examples?

930


Explain what does it mean when a pointer is used in an if statement?

817


What is cohesion and coupling in c?

778