write a program to input a number and check whether it is an even number or an odd number with an appropriate answer
Answers
Answered by
1
Answer:
#include <stdio.h>
int main() {
int num;
printf("Enter an integer: ");
scanf("%d", &num);
// True if num is perfectly divisible by 2
if(num % 2 == 0)
printf("%d is even.", num);
else
printf("%d is odd.", num);
return 0;
}
Answered by
0
In python ——-
n=float(input(“Enter no. :”))
if (n%2==0):
print(“no is even”)
else:
print(“no is odd”)
n=float(input(“Enter no. :”))
if (n%2==0):
print(“no is even”)
else:
print(“no is odd”)
Similar questions
Math,
3 months ago
English,
3 months ago
Computer Science,
3 months ago
Math,
7 months ago
Math,
7 months ago
Math,
11 months ago
Chemistry,
11 months ago
Social Sciences,
11 months ago