Syantax:
if(condition)
{
statement1;
statement2;
.
.
.
statement n;
}
#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:
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");
}
No comments:
Post a Comment