write the algorithm and flowchart for all this programs
1)write a program to check even or odd number
2)write a program to check whether the input is a vowel or a consonant
3)write a program to calculate simple interest
4)write a program to find the quotient and remainder
5)write a program to find the largest of 3 numbers
Answers
1. Write a program to check even or odd number.
Program:
n=int(input("Enter a number: "))
if n%2==0:
print("The number is even.")
else:
print("The number is odd."))
2. Write a program to check whether the input is a vowel or a consonant.
Program:
s=input("Enter a letter: ")
if s in "aeiou":
print("The letter is a vowel.")
else:
print("The letter is a consonant.")
3. Write a program to calculate simple interest.
Program:
p=float(input("Enter principal: "))
r=float(input("Enter rate: "))
t=int(input("Enter no. of years: "))
print("The simple interest is ", (p*r*t)/100)
4. Write a program to find the quotient and the remainder.
Program:
a=int(input("Enter the dividend: "))
b=int(input("Enter the divisor: "))
print("The quotient is ", a//b)
print("The remainder is ", a%b)
5. Write a program to find the largest of three numbers.
Program:
x=int(input("Enter a number, x: "))
y=int(input("Enter a number, y: "))
z=int(input("Enter a number, z: "))
if x>=y and x>=z:
print("x is the largest.")
elif y>=z:
print("y is the largest.")
else:
print("z is the largest.")
The flowcharts of the above given answers have been attached above. Kindly check it!