Skip to content

Commit

Permalink
Merge pull request seeditsolution#219 from Sagarmatsagar321/patch-2
Browse files Browse the repository at this point in the history
Create Find odd or even no
  • Loading branch information
seeditsolution authored Oct 2, 2020
2 parents 1a0651f + b0faacd commit 0765ceb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Find odd or even no
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* Program to check whether the input integer number
* is even or odd using the modulus operator (%)
*/
#include<stdio.h>
int main()
{
// This variable is to store the input number
int num;

printf("Enter an integer: ");
scanf("%d",&num);

// Modulus (%) returns remainder
if ( num%2 == 0 )
printf("%d is an even number", num);
else
printf("%d is an odd number", num);

return 0;
}

0 comments on commit 0765ceb

Please sign in to comment.