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 / robin
different compiler gives different ans..
this is for tc
but its true it work as stack
last in first out
value of k is store in stack
1. k = 20
2. ++k = 21 (Pre Increment )
3. k++ = 21 (Post Increment(k value now is 22))
4. k = 22
As 22 is last it is printed 1st.........
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Explain how do you determine the length of a string value that was stored in a variable?
Once I have used freopen, how can I get the original stdout (or stdin) back?
What should malloc(0) do?
How will you print TATA alone from TATA POWER using string copy and concate commands in C?
What is a scope resolution operator in c?
Can we declare variable anywhere in c?
Explain how can you avoid including a header more than once?
What is the general form of a C program?
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
Why is c platform dependent?
Explain how do you view the path?
Why c is called a middle level language?
Can we declare a function inside a function in c?
Explain how can you determine the size of an allocated portion of memory?
What's the total generic pointer type?