Quiz: else if

What does this program print?

#include <stdio.h>

int main(void) {
    int age = 70;

    if (age >= 18) {
        printf("Adult ticket\n");
    } else if (age >= 65) {
        printf("Senior ticket\n");
    } else {
        printf("Child ticket\n");
    }

    return 0;
}

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

7/13