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 does static variable mean in c?
What do you mean by Recursion Function?
cavium networks written test pattern ..
Explain what is the use of a semicolon (;) at the end of every program statement?
What are the 32 keywords in c?
What is the best way of making my program efficient?
What are the __date__ and __time__ preprocessor commands?
What are local variables c?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
Can math operations be performed on a void pointer?
What is preprocessor with example?
Explain modulus operator. What are the restrictions of a modulus operator?
Why we use int main and void main?
Explain the Difference between the New and Malloc keyword.
A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler