Wednesday, 10 September 2014

Even or odd program in C Language With Example

C Language program for finding even or odd numbers. The questions may be asked for this C program is, write a program to find even or odd number in C & write a program in c to find whether a number is even or odd? Keep that in your mind and perform like wise. It is an useful C program for beginners.

EVEN OR ODD IN C
Find the given value is Even or odd in C. This C program is used to find the input value will be odd number or even number by using conditional statement of if…else by using this condition of if(value%2==0) it correct it will be even else odd.



//Header file section
#include<stdio.h>
#include,conio.h>
 
void main()
{
    Clrscr(); //Function is used to clear previous output
    //Program variable
    int value;
 
    printf("\n\n Find the value is even or odd"); //Display function
    printf("\n\n Enter the value ");
    scanf("%d",&i); //Getting input value function
    if(value%2==0//Conditional statement
    {
        printf("\n Value is EVEN");
    }
    else
    {
        printf("\n Value is ODD");
    }
    getch();
}

No comments:

Post a Comment

Note: only a member of this blog may post a comment.