What is the output of following program ?
int
main()
{
int x = 5;
printf("%d %d %d\n", x, x << 2, x >> 2);
}
Answer Posted / vignesh1988i
4 4 1 is the output....
here the operation of STACK involves.... for these kind of statements (ie) statements having multiple values to get printed it is used..... so the very first element that goes inside stack is x , then x<<2 , then x>>2... so from the TOP it will be operated....
and print as the order given in printf statement..... :)
thank u
| Is This Answer Correct ? | 6 Yes | 16 No |
Post New Answer View All Answers
What does static variable mean in c?
What is the difference between variable declaration and variable definition in c?
How can I direct output to the printer?
How can I automatically locate a programs configuration files in the same directory as the executable?
why do some people write if(0 == x) instead of if(x == 0)?
What are header files and explain what are its uses in c programming?
Why flag is used in c?
What is character constants?
What is a newline escape sequence?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
What is the difference between declaring a variable by constant keyword and #define ing that variable?
How to declare a variable?
What is a global variable in c?
What is hungarian notation? Is it worthwhile?
How many types of functions are there in c?