WHAT WILL BE OUTPUT OF BELOW CODE . . AND PLEASE EXPLAIN HOW
IT COME ..
#include<stdio.h>
#include<conio.h>
void main()
{
int k=20;
printf("%d%d%d%d",k,k++,++k,k);
getch();
}
Answer Posted / vignesh1988i
22 21 21 20 THIS WILL THE OUTPUT..
this is merely an STACK operation.... here we have 4
parameters.. so the four parameters will be pushed inside
the stack one by one... as
TOP : k
++k
k++
BOTTOM : k
so the expressions will be evaluated from the top.. and thus
the answer....
thank u
| Is This Answer Correct ? | 9 Yes | 3 No |
Post New Answer View All Answers
How is a structure member accessed?
What is a macro?
Whats s or c mean?
Explain enumerated types.
Why c is called top down?
What is the difference between a free-standing and a hosted environment?
What is the difference between printf and scanf )?
What is static and volatile in c?
What is a null pointer in c?
What is the difference between the local variable and global variable in c?
What are the benefits of c language?
Is c is a low level language?
What is #define size in c?
Explain what is the benefit of using #define to declare a constant?
What is the difference between union and structure in c?