Friday, 17 February 2017

Simple if statement

Syantax:

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

}

Program :

#include<stdio.h>
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