This exercise is available at https://study.find-santa.eu/exercises/c/conditions/.
For the sake of the environment, please avoid printing these instructions in the future. Thank you!

Conditions

Below exercises serve to train conditions (if, switch and conditional expressions) in the C programming language.

You are not allowed to use the scanf function for reading user input. (This leaves fgets(.) or getline(.) together with sscanf(.) or parsing input via fgetc(.) family of functions.)

All of your code (including comments and identifiers) has to be written in English.

  1. Even or odd
    Write a C file that checks if a given number is even or odd.
    A sample run of this program:
    Enter a number: 26
    26 is even.
    
    Name the source file: even_or_odd.c
  2. Larger number
    Write a C file that prints the larger of two given numbers.
    A sample run of this program:
    First number: 20
    Second number: 12
    20 is larger.
    
    Name the source file: larger.c
  3. Largest number
    Write a C file that prints the largest of three given numbers.
    A sample run of this program:
    First number: 20
    Second number: 12
    Third number: 35
    35 is the largest number.
    
    Name the source file: largest.c
  4. RPN calculator
    Write a C file that implements a simple calculator using the reverse Polish notation. It is enough to perform a single operation.
    A sample run of this program:
    First operand: 20
    Second operand: 12
    Operator (+, -, *, /, %): +
    The result is 32.
    
    Name the source file: calculator.c