To find whether the given number is even or odd

Program:

#include<stdio.h>
#include<conio.h>
void main()
{
    int num;
    clrscr();
    printf("Enter a number : ");
    scanf("%d", &num);
    if(num % 2 == 0)
    printf("\nThe given number is even");
    else
    printf("\nThe given number is odd");
    getch();
}

Output:

Case: 1

Enter a number : 10
The given number is even

Case: 2

Enter a number : 5
The given number is odd