Computer Science, asked by yohalakshmi2003, 4 months ago

Write a program using functions to check whether a
number is even or odd. in python

Answers

Answered by Anonymous
4

Your solution is provided in attachemnt, check it out!

Attachments:
Answered by srirajnambiar
1

Answer:

Write a program using functions to check whether a

number is even or odd. in python

answer is :- program for the following question in python is given below;

number= int (input("enter a number "))

def numb():

   if (number %2 == 0):

       print("enter number is even")

   else:

       print ("enter number is odd")

res=numb()

Explanation:

In this programme, we take user input and store it in a variable called number. We then define a function called numb, and inside of this function, we use an if else conditional statement to check the condition. For example, to determine whether the input number is even, we check whether the remainder after dividing the number is equal to zero or not. If the remainder is zero, the statement "enter number is even" is printed; otherwise, the statement "enter number is odd" is printed.

To know about more click here,

brainly.in/question/18905944

To know about more click here,

brainly.in/question/16088081

#SPJ2

Similar questions