c > constructs > conditional_constructs

if_else.c


#include <stdio.h>

int main()
{
    int age;
    printf("Please enter your age: ");
    scanf("%d",&age);
    if(age>=18){
        printf("You are an adult\n");
    }else{
        printf("You are not an adult as yet\n");
    }
    return 0;
}