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 / vishwanath pillay
The answer will be :-
20, 21, 21, 21
At the start the value is initialized to 20.
since the line:-
printf("%d%d%d%d",k,k++,++k,k);
Answer:-- 20, 21, 21, 21
| Is This Answer Correct ? | 0 Yes | 11 No |
Post New Answer View All Answers
What is difference between structure and union in c?
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
Are the variables argc and argv are local to main?
What is the purpose of void in c?
How does placing some code lines between the comment symbol help in debugging the code?
What is c basic?
Why c is called object oriented language?
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
What is variable and explain rules to declare variable in c?
How many keywords are there in c?
explain what is an endless loop?
What is meant by int main ()?
Explain what are compound statements?
Why use int main instead of void main?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10