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 / karthikeyan
20 20 22 22
solution
1) k corresponds to 20 20
2) k++ corresponds to k = k then k+1 20
after assignment k becomes 21
3) ++k corresponds to k + 1 then k = k 22
4) k corresponds to k 22
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12
What is the use of #define preprocessor in c?
What is the easiest sorting method to use?
What is string concatenation in c?
Is c high or low level?
Explain what is the use of a semicolon (;) at the end of every program statement?
What is sizeof array?
What is the collection of communication lines and routers called?
Explain how can type-insensitive macros be created?
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
How can you tell whether a program was compiled using c versus c++?
What is meant by preprocessor in c?
What is the use of getchar functions?
What is the use of a conditional inclusion statement in C?