Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions odd.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// this is a program to check whether a number is odd or even
#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
if(n%2==0)
printf("Odd\n");
else
scanf("%d",&n);//reading the number to be checked
if(n%2==0)//check whether number is divisible by two
printf("Even\n");
else
printf("Odd\n");
return 0;
}