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
What is the acronym for ansi?
Explain union. What are its advantages?
How do I send escape sequences to control a terminal or other device?
What are enums in c?
What is the most efficient way to count the number of bits which are set in an integer?
Where register variables are stored in c?
What is the process to generate random numbers in c programming language?
What are compound statements?
Tell me is null always defined as 0(zero)?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
How do you use a pointer to a function?
What is a program flowchart?
Distinguish between actual and formal arguments.
Who is the founder of c language?
What is linear search?