Example for if else statement in c language
Example for if else statement in c language
Program:-
#include<stdio.h>
#include<conio.h>
main()
{
int a;
clrscr();
printf("choose any number from 0 to 9 ");
scanf("%d",&a);
if(a==1)
printf("u have entered one ");
else if(a==2)
printf("u have entered two");
else if(a==3)
printf("u have entered three");
else if(a==4)
printf("u have entered four");
else if(a==5)
printf("u have entered five");
else if(a==6)
printf("u have entered six");
else if(a==7)
printf("u have entered seven");
else if(a==8)
printf("u have entered eight");
else if(a==9)
printf("u have entered nine");
else if(a==0)
printf("u have entered zero");
getch();
}
Output :-
Enter your choice 5
you enter 5
...........
...........
............on
No comments
Post a Comment