if else program in C.

 

01 #include<stdio.h>
02
03 int main()
04 {
05 int i;
06 printf("Press 0 : ");
07 scanf("%d",&i);
08 if(i==0)
09 {
10 printf("Zero is PRESSED");
11 }
12 else
13 {
14 printf("Zero is NOT PRESSED");
15 }
16 return 0;
17 }
 
 
OUTPUT :

(1st Run)
Press 0 : 0
Zero is PRESSED

(2nd Run)
Press 0 : 3
Zero is NOT PRESSED

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *