Computer Science, asked by BEASTHUNTER01, 7 months ago

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 saidulnayan781
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 gitsup
0
In python ——-

n=float(input(“Enter no. :”))

if (n%2==0):
print(“no is even”)
else:
print(“no is odd”)
Similar questions