C - onditional Statements
Examine the following nested if code snippet. What is the logical error?
int num = 7;
if (num > 0) {
if (num % 2 == 0)
printf("Even\n");
else
printf("Odd\n");
} else
printf("Non-positive\n");Examine the following nested if code snippet. What is the logical error?
int num = 7;
if (num > 0) {
if (num % 2 == 0)
printf("Even\n");
else
printf("Odd\n");
} else
printf("Non-positive\n");15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions