int i=3;
printf("%d%d",i,i++);
what is output?
Answers
Answered by
1
Answer:
43
Explanation:
II Its Solved questions
Answered by
0
Answer:
The output of the code is 43.
Explanation:
int i=3;
printf("%d%d",i,i++);
- At first sight, it felt that the output of the code will be either 34 or 33. But both are incorrect.
- These kinds of codes are known as the exception code that doesn't give the output as we might think.
- Here we have an integer variable i with the value 3.
- Then we print the value of i and incrementation of i,
- In the second line, the value of i is incremented by one by the postfix operator so 3+1 =4, and 4 is printed.
- since the second format specifier wants to print i with the previous value. So 3 is printed.
- Hence, we get the output as 43.
#SPJ2
Similar questions
India Languages,
6 months ago
Hindi,
6 months ago