»Question based on computer science(Python)
» Answer Q4, a,b,c and d part.
[I request to give right answers, urgently needed. ]
Answers
Answer:
(a)
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
num3 = float(input("Enter third number: "))
if (num1 > num2) and (num1 > num3):
largest = num1
elif (num2 > num1) and (num2 > num3):
largest = num2
else:
largest = num3
print("The largest number is ", largest)
(b)
principal = float(input("Enter the principal amount:"))
time = int(input("Enter the time(years): "))
rate = float(input("Enter the rate: "))
simple_interest = (principal*time*rate)/100
print("The simple interest is: ",simple_interest)
(c)
num = int(input("Enter age: "))
if (age>=18) :
print("{0} is Eligible to vote".format(num))
else:
print("{0} is not eligible to vote ".format(num))
(d)
num = int(input("Enter a number: "))
if (num % 2) == 0:
print("{0} is Even ".format(num))
else:
print("{0} is Odd ".format(num))