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 / anand
The answer should be 22212120
Arguments passed to the printf statement would get executed
from the right to left..
1. k = 20
2. ++k = 21 (Pre Increment)
3. k++ = 21 (Post Increment(k value now is 22))
4. k = 22
Thus the output : 22212120
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Why is c fast?
What is the purpose of macro in C language?
how to construct a simulator keeping the logical boolean gates in c
What does 3 mean in texting?
Why do we need arrays in c?
Is c# a good language?
What are the types of pointers in c?
Explain why can’t constant values be used to define an array’s initial size?
How would you rename a function in C?
What is %g in c?
What are pointers? What are stacks and queues?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
What are inbuilt functions in c?
What is merge sort in c?
What's a good way to check for "close enough" floating-point equality?