C/C++ Arena

Step 2 of 6

else if chains

Chain several conditions with else if. C checks them top to bottom and runs only the first one that's true.

if (score >= 90) {
    printf("A\n");
} else if (score >= 80) {
    printf("B\n");
} else {
    printf("C or lower\n");
}

Your turn: read a player's kill count for a round and print:

Previous: if and else Next: And, or, not