• Language

    C

  • Description

    Even or odd number

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
#include <stdlib.h>

int main (void)
{
    int number;
    printf ("Enter the value of number: ");
    scanf ("%d", &number);
    (void) getchar ();
    if(number%2==0)
        printf ("The number is even\n");
    else
        printf ("The number is odd\n");
    putchar ('\n');
    system ("pause");
    return EXIT_SUCCESS;
}