Monday 20 March 2017

Simple if statement

Syantax:

if(condition)
{
 statement1;
 statement2;
 . 
 .
 .
 statement n;

}

Program :

#include
void main()
{
    int age;
    printf(" >>> c program to implement simple if<<< \n\n");
    printf("\n Enter the age of the person: ");
    scanf("%d",&age);
    if(age>=18)
    {
        printf("\n Eligible for Licence \n");
    }
    printf("\n program ends \n\n");
}


Output:






No comments:

Post a Comment