#include <stdio.h>

int main() {

    // One equal vs. two equals
    int score = 80;

    if (score = 100)
        printf("You get the scholarship.\n");

    /*** Alternative: if (100 == score) ... ***/

    // matching else problem
    int money = 50, free = 0;
    if (money > 100)
        if (free == 1)
            printf("I can go out.\n");
    else
        printf("I am poor.\n");

    // Chaining inequalities
    int age = 99;
    if (15 <= age <= 19) /*** 15 <= age && age <= 19 ***/
        printf("You can go out for teen night, YEAH!!!\n");

    // or instead of and
    int ans = 11116;
    if (ans > 1 || ans < 6)
        printf("Your answer was in between 2 and 5, inclusive.\n");

    /*** Inadvertent semicolon ***/
    age = 15;
    if (age >= 21);
        printf("Have a beer, you're in Europe!!!\n");

    /*** Lack of braces ***/
    age = 40;
    if (age >= 65) {
        printf("Get your retirement money while you can.\n");
        printf("And cheap hair cuts...\n");
    }
    else {
        printf("Too bad, you have to work...\n");
        printf("And pay too much for haircuts...\n");
    }


    return 0;
}
