Write a program to find whether the given number is odd or even using simple-if.

/* Write a program to find whether the given number

is odd or even using simple-if.*/

#include <stdio.h>

void main()

{

    int n;

    printf("Enter the number : ");

    scanf("%d",&n);

    printf("The given number is ");

    if(n%2==0)

        printf("Even\n");

    else

        printf("Odd\n");

    getch();

}

Comments

Popular posts from this blog

Write a program to accept numerator and denominator and find the remainder without using modulus (%) operator using do..while loop.