C Online Compiler
Example: C Program to Check Whether a Number is Even or Odd using If-else Statement
C
C++
C#
Java
Python
PHP
main.c
STDIN
Run
// C Program to Check Whether a Number is Even or Odd using If-else Statement #include <stdio.h> int main() { int x; printf ("Enter an integer number to check ::\n"); scanf ("%d", &x); if (x % 2 == 0) { printf ("The input number is even.\n"); } else { printf ("The input number is odd.\n"); } return 0; }
7
Output
Clear
ADVERTISEMENTS