Odd or Even in C


In this example, you will learn to check whether a number entered by the user is even or odd.

Source Code

/*
Any integer is input through the keyboard. Write a program to find out
whether it is an odd number or even number.
(Hint: Use the % (modulus) operator)
*/
#include<stdio.h>
 
int main()
{
    int n;
    printf("\nEnter The Value : ");
    scanf("%d",&n);
    if(n%2==0)
    {
        printf("\n%d is even number",n);
    }
    else
    {
        printf("\n%d is odd number",n);
    }
    return 0;
}
 
}   To download raw file Click Here

List of Programs


Sample Programs


Switch Case in C


Conditional Operators in C


Goto Statement in C


While Loop Example Programs


Looping Statements in C

For Loop Example Programs


Array Examples in C

One Dimensional Array


Two Dimensional Array in C


String Example Programs in C


Functions Example Programs in C


Learn All in Tamil © Designed & Developed By Tutor Joes