What will be the output of following code snippet if x=5 y=10? Int val=(x>=y)? ++x++y
Answers
Answered by
2
Explanation:
it will give error as u have written printf(“”%d””,a) i.e. %d is not belonging within quotes. If it is mistakenly typed then it will give result as 15. As the expression is a=I++ +j; so, first it will take the value of I and then increment so, it will take I value as 5 and j as 10. S0, 5+10=15;
If the expression will be like a=I+ ++j; then it will be 5+11=16. Hope you got the answer
Similar questions