CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Nested If-Else Chain

C code walkthrough · Question 7
easyIf Statements

Code

Read carefully. What does this print?
1#include <stdio.h>
2 
3int main() {
4 int score = 75;
5 if (score >= 90) {
6 printf("A\n");
7 } else if (score >= 80) {
8 printf("B\n");
9 } else if (score >= 70) {
10 printf("C\n");
11 } else if (score >= 60) {
12 printf("D\n");
13 } else {
14 printf("F\n");
15 }
16 return 0;
17}

Your answer