Computer Science, asked by parvez001, 6 months ago

Q1. Write a Python program to input three number and print minimum of them.
(3)
3​

Answers

Answered by anindyaadhikari13
4

\star\:\:\:\bf\large\underline\blue{Question:-}

  • Write a Python program to input 3 numbers and print the smallest number among them.

\star\:\:\:\bf\large\underline\blue{Source\:Code:-}

a = int(input('Enter The First Number : '))

b = int(input('Enter The Second Number : '))

c = int(input('Enter The Third Number : '))

d= 0

if (a < b) and (a < c):

d=a

elif (b < a) and (b < c):

d=b

else:

d=c

print("The smallest of the 3 numbers is : ", d)

\star\:\:\:\bf\large\underline\blue{Similar\:Questions:-}

  • Write a program in python to find the second largest number among 3 numbers.
  • Write a program in python to find the largest number among 3 numbers.
Answered by abhi230204
4

Answer:

number1 = int(input('Enter First number : '))

number2 = int(input('Enter Second number : '))

number3 = int(input('Enter Third number : '))

def largest(num1, num2, num3):

if (num1 > num2) and (num1 > num3): largest_num = num1 elif (num2 > num1) and (num2 > num3):

largest_num = num2 else: largest_num = num3 print("The largest of the 3 numbers is : ", largest_num)

def smallest(num1, num2, num3):

if (num1 < num2) and (num1 < num3): smallest_num = num1 elif (num2 < num1) and (num2 < num3):

smallest_num = num2

else:

smallest_num = num3 print("The smallest of the 3 numbers is : ", smallest_num)

largest(number1, number2, number3)

smallest(number1, number2, number3)

Explanation:

  • hope it helps you..
  • abhi230204
Similar questions