0

Please explain this code???

int i = (int)7.8; double d = 5.7; if(i > d && d < 6 && i > 7.5) printf("con1" + i *(int)d); else{ int x = (i < d)? d - i:i- d; printf("con2" + x); } return 0;

5th Jan 2020, 5:46 PM
Sachin Shah
Sachin Shah - avatar
1 Answer
+ 2
if condition fails, then the else is executed where the x value becomes 1. That print statement means that print every character of that string from index 1. Hence the answer on2.
5th Jan 2020, 6:07 PM
Avinesh
Avinesh - avatar