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

answer is

22 21 21 20

printf .. executes from left hand side..


so first ..

printf("$d %d %d %d",k,K++,++k,k);

4.last k ie; 20
3.++k (pre) : 21
2.k++ (post) : 21 and then increamented
1.k : 22

answer is : 22 21 21 20

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How main function is called in c?

622


What is wrong in this statement? scanf(ā€œ%dā€,whatnumber);

722


What math functions are available for integers? For floating point?

616


What does c mean in standard form?

593


List the variables are used for writing doubly linked list program.

1615






how to make a scientific calculater ?

1557


Why is c called a structured programming language?

671


Is null always equal to 0(zero)?

578


Differentiate between ordinary variable and pointer in c.

613


What is pointer to pointer in c with example?

544


a program that can input number of records and can view it again the record

1476


Multiply an Integer Number by 2 Without Using Multiplication Operator

314


What is chain pointer in c?

599


What is break in c?

580


how to introdu5ce my self in serco

1521