Skip to content

Commit b3ccf7d

Browse files
committed
if if even odd
1 parent 3b0f7a8 commit b3ccf7d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

prog.6.3.c

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Program to determine if a number is even or odd
2+
3+
#include <stdio.h>
4+
5+
int main (void)
6+
{
7+
int number_to_test, remainder;
8+
9+
printf ("Enter your number to be tested.: ");
10+
scanf ("%i", &number_to_test);
11+
12+
remainder = number_to_test % 2;
13+
14+
if ( remainder == 0 )
15+
printf ("The number is even.\n");
16+
17+
if ( remainder != 0 )
18+
printf ("The number is odd.\n");
19+
20+
return 0;
21+
}

0 commit comments

Comments
 (0)