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();
}

Answers were Sorted based on User's Feedback



WHAT WILL BE OUTPUT OF BELOW CODE . . AND PLEASE EXPLAIN HOW IT COME .. #include<stdio.h>..

Answer / pratik

but how answer came ? ?

Is This Answer Correct ?    0 Yes 3 No

WHAT WILL BE OUTPUT OF BELOW CODE . . AND PLEASE EXPLAIN HOW IT COME .. #include<stdio.h>..

Answer / vijay

20 21 20 20

Is This Answer Correct ?    2 Yes 7 No

WHAT WILL BE OUTPUT OF BELOW CODE . . AND PLEASE EXPLAIN HOW IT COME .. #include<stdio.h>..

Answer / 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

WHAT WILL BE OUTPUT OF BELOW CODE . . AND PLEASE EXPLAIN HOW IT COME .. #include<stdio.h>..

Answer / shashikant

20,20,22,22

Is This Answer Correct ?    2 Yes 15 No

WHAT WILL BE OUTPUT OF BELOW CODE . . AND PLEASE EXPLAIN HOW IT COME .. #include<stdio.h>..

Answer / priyanka

20,20,21,20

Is This Answer Correct ?    5 Yes 20 No

Post New Answer

More C Interview Questions

What is the size of a union variable?

0 Answers  


What is c method?

0 Answers  


10. Study the code: void show() main() { show(); } void show (char *s) { printf("%sn",s); } What will happen if it is compiled & run on an ANSI C Compiler? A)It will compile & nothing will be printed when it is executed B)it will compile but not link C)the compiler will generate an error D)the compiler will generate a warning

5 Answers   Accenture,


An interactive c program to read basic salary of 15 persons. each person gets 25% of basic as HRA, 15%of basic as conveyance allowances, 10%of basic as entertainment allowances.The total salary is calculated by adding basic+HRA+CA+EA.Calculate how many out of 15 get salary above 10,000.Rs also print the salary of each employee

2 Answers  


Difference between Class and Struct.

13 Answers   Ericsson, Motorola, Wipro,






write a c program to check weather a particluar bit is set or not?

5 Answers   IBM,


void swap(int a,int b) { a=a+b; b=a-b; a=a-b; } in this code always gives the same result for all case

9 Answers   Accenture, TCS,


What is pre-emptive data structure and explain it with example?

0 Answers  


Why do we write return 0 in c?

0 Answers  


By using C language input a date into it and if it is right?

0 Answers   Aricent,


Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.

0 Answers  


what is Array?

3 Answers  


Categories