Computer Science, asked by learningstudent52, 5 months ago

Write a program to take a number as input from the user and check if it is even
number or odd number​

Answers

Answered by khandgave
1

Answer:

Write a Python program to find whether a given number (accept from the user) is even or odd, print out an appropriate message to the user. Python Code: num = int(input("Enter a number: ")) mod = num % 2 if mod > 0: print("This is an odd number. ") else: print("This is an even number.

Explanation:

Thx for free points

Mark me as brainlist

Thank my answer

Answered by Anish1703
2

Answer:

#include<stdio.h>

int main()

{

// This variable is to store the input number

int num;

printf("Enter an integer: ");

scanf("%d",&num);

// Modulus (%) returns remainder

if ( num%2 == 0 )

printf("%d is an even number", num);

else

printf("%d is an odd number", num);

return 0;

}

Explanation:

I hope ot will help you

Similar questions