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 / karthikeyan
20 20 22 22
solution
1) k corresponds to 20 20
2) k++ corresponds to k = k then k+1 20
after assignment k becomes 21
3) ++k corresponds to k + 1 then k = k 22
4) k corresponds to k 22
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
What are the different file extensions involved when programming in C?
Write a program to find factorial of a number using recursive function.
What is the right type to use for boolean values in c? Is there a standard type?
What is bin sh c?
How can I prevent another program from modifying part of a file that I am modifying?
What is formal argument?
What functions are used in dynamic memory allocation in c?
What is the argument of a function in c?
What is function prototype in c with example?
Where is c used?
Can you please explain the difference between strcpy() and memcpy() function?
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 is the explanation for modular programming?
Explain how do you use a pointer to a function?
How the c program is executed?