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

Write a program in c using only loops to print * * * * * *******

2 Answers   IBM,


Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)

0 Answers  


Please list all the unary and binary operators in C.

3 Answers  


what is a far pointer

12 Answers   ABB, DRDO, ITI, Maruti Suzuki, Steel Plant, TCS, Toyota, Vivo Mobiles,


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

0 Answers   Amazon,






Whats s or c mean?

0 Answers  


What is default value of global variable in c?

0 Answers  


design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.

0 Answers   TCS,


How many types of errors are there in c language? Explain

0 Answers  


Explain how do you override a defined macro?

0 Answers  


Is main is user defined function?

0 Answers  


What's the difference between DELETE TABLE and TRUNCATE TABLE commands?

2 Answers   CTC,


Categories