In this Article, you will learn how to Check whether the number is Even or odd. We have shared the source code of odd and even number in c program. You can follow this article to get the source code of how to find odd and even numbers in c programming. you can share this article with your friends who all are interested in c programming.
C Program to Check whether the number is Even or Odd |
Click on this link below to get some more c programs:
- C Program to swap two number with using third variable
- C Program to find the factorial of the number
- C Program to check whether the number is Palindrome or not
- C Program to swap two number without using Third variable
- C Program to display Fibonacci in c using for loop
- C Program using Switch case to enter a digit (0-9) and write in word
- C program to print the factor of the number
Even number|Odd Number|
An even number is a number which is divided by 2 (two) and has 0 (zero) remainder or no remainder.
Some Examples of even number are :2,4,6,8,10,,,,,,
An odd number is a number which is also divided by 2 (two),but has its remainder or fraction.
Some Examples of odd number are:1,3,5,7,9,11...….
C Program to Check whether the number is Even or Odd|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | /* C program to check whether a number is Even od Odd */ #include<stdio.h> int main(){ int n; printf("\nEnter an Integer:"); scanf("%d",&n); if(n%2==0) { printf("The number is an even number "); } else { printf("The number is an odd number"); return 0; } } |
Output:
I hope you have read our Article " C Program to check whether the number is even or odd" and you have collected lots of information from there. If you like the post, then please comment and share among your friends and family. you can write your opinion about my post in the comment box.
Thank you!
No comments:
Post a Comment
If you have any queries ,please let us know