C Program to Find the Given Number is Odd or Even
Write a C program to find whether the given number is odd or even.
Answers
Answered by
5
#include<stdio.h>
void main()
{
int a;
clrscr();
printf("given number:");
scanf("%d",&a);
if(a%2==0)
printf("%d is even number");
else
printf('%d is odd number");
getch();
}
output for the above program is
given number:4
4 is even number
void main()
{
int a;
clrscr();
printf("given number:");
scanf("%d",&a);
if(a%2==0)
printf("%d is even number");
else
printf('%d is odd number");
getch();
}
output for the above program is
given number:4
4 is even number
Answered by
0
Answer:#include<stdio.h>
#include<conio.h>
void main()
{
int x;
clrscr();
printf("Enter the value of x:");
scanf("%d",&x);
if(a%2==0)
{
printf("x is even");
}
else
{
printf("x is odd");
getch();
}
Explanation:
Similar questions
Math,
8 months ago
English,
8 months ago
Environmental Sciences,
1 year ago
Math,
1 year ago
English,
1 year ago