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
What is chain pointer in c?
What does %p mean c?
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
What is the explanation for the dangling pointer in c?
Explain high-order and low-order bytes.
why do some people write if(0 == x) instead of if(x == 0)?
What is the difference between int main and void main?
Difference between malloc() and calloc() function?
How many types of operator or there in c?
What are the types of i/o functions?
What are the data types present in c?
Describe explain how arrays can be passed to a user defined function
Describe the difference between = and == symbols in c programming?
Write a program for finding factorial of a number.
What should malloc() do? Return a null pointer or a pointer to 0 bytes?