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 / puja
THE ANSWER WILL BE
20 20 22 22
BECAUSE THE FIRST VALUE IS K=20 THEN IT WILL BE THE SAME
20 DUE TO K++, NOW THE VALUE WILL BE INCREMENTED & WILL BE
21, THEN ++K, MEANS THE VALUE WILL BE +1 THEN IT WILL BE 22
& LAST K WILL BE SAME 22.
| Is This Answer Correct ? | 3 Yes | 5 No |
Post New Answer View All Answers
What is f'n in math?
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
Is c compiled or interpreted?
What is the difference between Printf(..) and sprint(...) ?
Explain the difference between strcpy() and memcpy() function?
write a c program to find the sum of five entered numbers using an array named number
What are loops c?
How do I swap bytes?
how to make a scientific calculater ?
using for loop sum 2 number of any 4 digit number in c language
What is dangling pointer in c?
Why void is used in c?
Can you please explain the scope of static variables?
What are the 4 data types?
What is the difference between strcpy() and memcpy() function in c programming?