Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

Answers were Sorted based on User's Feedback



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

Answer / san

13,11,11

Is This Answer Correct ?    93 Yes 48 No

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

Answer / nitin

13 11 13

Is This Answer Correct ?    52 Yes 24 No

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

Answer / dhivya

11 11 13
++i which means i is first incremented and then printed thus i value becomes 11,
i++ which means i is printed and then it is incremented, since the value of i is now 11, it is printed and then incremented to 12.
again ++i , increments i to 13 and then prints.

Is This Answer Correct ?    60 Yes 34 No

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

Answer / 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 ?    24 Yes 8 No

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

Answer / krityangan

The Answer is 13 11 13
because the post increment will printed first and then pre.
i=10
the ++i=11,i++=12,++i=13,but in c the compiler will print ++p which is now 13 and after that when the compiler come to i++ it will print 11 because in the pre addition the previous vale is printed first andthan i= 12.

Is This Answer Correct ?    21 Yes 10 No

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

Answer / rajjak khan

131113

Is This Answer Correct ?    2 Yes 1 No

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

Answer / pooja alagarsamy

when compiled as a program, it gives this output:

13 11 13

Is This Answer Correct ?    1 Yes 0 No

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

Answer / sanjay kumar

Undefined behaviour

Is This Answer Correct ?    5 Yes 20 No

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

Answer / thaslima

11,10,11

Is This Answer Correct ?    6 Yes 30 No

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

Answer / senthil

13 12 13

Is This Answer Correct ?    2 Yes 26 No

Post New Answer



More C Interview Questions

what is the output of below code int x=8,y; x>>=2; y=x; what is y value. NOTE:EXPLANATION IS COMPALSARY with binary bits

2 Answers   Wipro,


find the output of the following program main() { int x=5, *p; p=&x; printf("%d",++*p); }

10 Answers   Amdocs, TCS,


main() { int x, arr[8]={11,22,33,44,55,66,77,88}; x=(arr+2)[3]; printf(ā€œ%dā€,x); }

8 Answers   Vector,


we have to use realloc only after malloc or calloc ? or we can use initially with out depending on whether we are using malloc or calloc in our program ?

2 Answers  


List out few of the applications that make use of Multilinked Structures?

1 Answers   Accenture,






What is C language ?

0 Answers   Jekson,


what is the mean of c languages.

1 Answers   Polaris,


how can i get the output 54321 4321 321 21 1 in c programming........???? pls help......

10 Answers   Infosys,


Juxtapose the use of override with new. What is shadowing?

1 Answers  


what is the difference between postfix and prefix unary increment operators?

3 Answers  


Explain the use of bit fieild.

0 Answers  


What is the difference between a string and an array?

0 Answers  






Categories