condition

C Conditional Statements

C Conditional Statements

Conditional statements are used to perform different actions based on different conditions.

if Statement

#include 

int main() {
    int age = 20;
    if (age >= 18) {
        printf("You are an adult.\n");
    } else {
        printf("You are a minor.\n");
    }
    return 0;
}
    

This program checks if the person is an adult (18 or older) and prints the corresponding message.