C Program to Check Whether a Number is Odd or Even

In this program we will take number from user as input and check if the entered number is odd number or even number.

  1. //C Program to check whether a number is odd or even
  2. #include<stdio.h>
  3. int main()
  4. {
  5. int a;
  6. printf("Enter a number: ");
  7. scanf("%d", &a);
  8. if(a%2==0)
  9. {
  10. printf("The entered number is even");
  11. }
  12. else
  13. {
  14. printf("The entered number is odd");
  15. }
  16. return 0;
  17. }

download android app

Popular C Examples


Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube