Determine Output:
void main()
{
int i=5, j=6, z;
printf("%d", i+++j);
}
void main()
{
int i=5, j=6, z;
printf("%d", i+++j);
}
A. 12
B. 13
C. 11
D. None of These
Answer: Option C
Solution(By Examveda Team)
The expression i+++j is treated as ((i++) + j)
Join The Discussion
Comments ( 4 )
Related Questions on C Miscellaneous
Determine output:
void main()
{
int const *p=5;
printf("%d", ++(*p));
}
A. 6
B. 5
C. Garbage Value
D. Compiler Error
A. mmm nnn aaa
B. mmmm nnnn aaaa
C. Compiler Error
D. None of These
A. I hate Examveda
B. I love Examveda
C. Error
D. None of These
Determine Output:
void main()
{
static int var = 5;
printf("%d ", var--);
if(var)
main();
}
A. 5 5 5 5 5
B. 5 4 3 2 1
C. Infinite Loop
D. None of These
i++ is post increment so will not increase by 1
5++ + 6=11
if(i++)+j means (5+1)+6=12 how it will print 11
here the (i++)+j means (5+1)+6=12
why is it not treated as i+(++j) ?