Q2 Any Integer is input through the keyboard. Write a program to find out whether it is an odd number or even number.

Any Integer is input through the keyboard. Write a program to find out whether it is an odd number or even number.

Program: 70

Any Integer is input through the keyboard. Write a C program to find out whether it is an odd number or even number.

#include<stdio.h>
#include<conio.h>
int main()
{
    int num;

    printf("Enter any integer: ");
    scanf("%d", &num);

    if(num%2==0)
    {
       printf("%d is  Even Number", num);
    }
    else
    {

       printf("%d is Odd Number", num);
    }

    return 0;
}

Output:

 Enter any integer: 128
 128 is  Even Number
Lokesh Kumar: Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.
Related Post
Leave a Comment

This website uses cookies.