main()
{
int i=5;
printf("%d%d%d%d",i++,i--,i);
}
Answer Posted / sravan kumer
Answer is 455848 in 'Turbo C++'
because here gave 4 %d's but given variables to print are 3.
So here Turbo C++ will evaluate first 3 parameters given as
---> first i will be evaluated so i=5 because printf() evaluates from right to left.
---> then i-- is 5 because it is post decrement so 1st prints value and then increments i=4
---> then i++ is post increments so 1st prints i value i.e 4
and then it will be incremented to 5.
---> so it printf will print 455 but there is another %d ,printf will handle those with a garbage values i.e 848 here.
so answer is 455848.i.e 455 is common after that some garbage value will be printed.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Write a program to check prime number in c programming?
What is difference between structure and union with example?
What is a good way to implement complex numbers in c?
What are local variables c?
Write a program to print fibonacci series without using recursion?
What is difference between constant pointer and constant variable?
How can I access an I o board directly?
what is a constant pointer in C
What is the difference between NULL and NUL?
What is the scope of local variable in c?
What is the advantage of c?
What does c value mean?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
What is meant by type casting?
What is modeling?