Hello I had some questions for a quiz that I got wrong cause I was confused on them. Would anyone please be kind enough to tell me why each code outputs what it does?
1.
Code:
int a=13, b=5;
if (3 < a < 10)
printf("A");
b = 2*a;
printf("%d", b);
shouldn't this just output 26 since 13 isn't less than 10?
2.
Code:
int a=8;
if (a = 5) {
printf("A");
}
else
printf("B");
printf("%d", a);
shouldn't this just output B due to 8 not being equal to 5?
3.
Code:
int a=3, b=8;
if (a > 3)
if (b < 5)
printf("A");
else
printf("B");
printf("C");
why doesn't this output both b and c?