4. C – Simple IF ELSE

#include<stdio.h>
void main()
{
    int age;
    printf("Please Enter your Age :");
    scanf("%i",&age); //scanf will read an input.
    if (age > 18) //simple if condition
    {
      printf("Eligible for Driver's License");
    }
    else
    {
      printf("Not Eligible for Driver's License");
    }
}


Output:

%d bloggers like this: