This is program that ask user to check whether the given number is odd or even. That number divided by odd number Is odd else it is even. In this program user declare required variables that are use to contain the value. And the control statement also used like if else for checking the manipulated condition. If the given digit division able with odd number then it will be odd else it will be even number.
Problem Statement:
This is the C program where users ask to check the number is odd or even.
- Declaring variable.
- Using control statement.
- Display result on the screen.
Here is C source code for check whether the Given Number is odd or even. The output of this program shown below
#include<stdio.h>
void main()
{
int a;
clrscr();
printf ("Enter the No : ");
scanf("%d",&a);
if(a%5==0)
{
printf("No.is Divisible by 5");
}
else
{
printf("No is not Divisible by 5");
}
getch();
}
Output :