Monday, 23 February 2015

Nested If in C


#include<stdio.h>
#include<conio.h>
main()
{
int a;
clrscr();
printf("\n Enter Number ( 1 - 2 - 3 ) :");
scanf("%d",&a);

if(a>0&&a<4)
{
if(a==1)
{
printf("\n Given Number is One");
}
else if(a==2)
{
printf("\n Given Number is Two");
}
else
{
printf("\n Given Number is Three");
}
}
getch();
}

No comments:

Post a Comment