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 a memory leak? How to avoid it?
Tell me about low level programming languages.
What is the use of header?
which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +
What is structure in c language?
How can I manipulate individual bits?
What are the uses of a pointer?
Write a code on reverse string and its complexity.
What are the different categories of functions in c?
What are the different types of objects used in c?
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0
what are bit fields? What is the use of bit fields in a structure declaration?
can we change the default calling convention in c if yes than how.........?
How do we open a binary file in Read/Write mode in C?
How many loops are there in c?