[prev] 46 [next]

Exercise #3: Conditionals

  1. What is the output of the following program?

    if ((x > y) && !(y-x <= 0)) {
        printf("Aye\n");
    } else {
        printf("Nay\n");
    }
    

  2. What is the resulting value of x after the following assignment?

    x = (x >= 0) + (x < 0);