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
What is the explanation for the dangling pointer in c?
Why is this loop always executing once?
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
what value is returned to operating system after program execution?
Explain spaghetti programming?
What are the types of i/o functions?
how to count no of words,characters,lines in a paragraph.
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
What is chain pointer in c?
please send me the code for multiplying sparse matrix using c
How can I get back to the interactive keyboard if stdin is redirected?
Explain the process of converting a Tree into a Binary Tree.
What does == mean in texting?
What are the differences between new and malloc in C?
What is c variable?