// Arup Guha
// 9/7/2011
// Illustrates different versions of the if statement.
#include <stdio.h>

int main() {

    // Is it raining?
    int answer;
    printf("Is it raining(0 = no, 1 = yes)?\n");
    scanf("%d", &answer);

    // Do you have an umbrella.
    int have_umbrella;
    printf("Do you have an umbrella(0 = no, 1 = yes)?\n");
    scanf("%d", &have_umbrella);

    // You will get wet!
    if (answer == 1 && have_umbrella == 0) {
        printf("Sorry, you will get wet.\n");
        printf("You should buy an umbrella!!!\n");
    }

    // In this case, you are ready for the rain.
    else if (answer == 1) {
        printf("Great, you are prepared for the rain.\n");
    }

    // No rain and no umbrella.
    else if (answer == 0 && have_umbrella == 0) {
        printf("Sorry, you will get a sunburn.\n");
        printf("Buy some sunscreen!!!\n");
    }

    // no rain with an umbrella
    else {
        printf("Great, you can handle the sun with your umbrella.\n");
    }

    // End greeting that always prints.
    printf("The program is over.\n");

    return 0;
}
