Skip to content

Commit 0668418

Browse files
authored
Create if else statement
0 parents  commit 0668418

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

if else statement

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* Humza Khawar
2+
3+
IF..ELSE
4+
*/
5+
6+
#include<stdio.h>
7+
8+
int main()
9+
{
10+
// variable declaration & initialization
11+
int j = 4;
12+
int k;
13+
k = j * 4 % 5;
14+
int min = k;
15+
16+
//checking greater number
17+
18+
if (j < k)
19+
{
20+
//if j is less than k
21+
min = j;
22+
printf("j is smaller than k\n");
23+
}
24+
else
25+
//if k is less than j
26+
printf("j is larger than or equal to k \n");
27+
28+
//final print statement to print minimum number
29+
printf("min = %d \n", min);
30+
return 0;
31+
32+
getchar();
33+
return 0;
34+
}

0 commit comments

Comments
 (0)