write a program to enter three numbers and a character. Find and display sum of the numbers if the given character is 's' and product of the numbers if the given character is 'p'.The program displays a message "Invalid Character "if the user enters a letter other than 's' or 'p'
Answers
Answered by
0
Answer:
(for python )
a = int(input("write first number")
b = int(input("write second number")
c = input("press s or p for sum")
if c == "s" or "p":
print("your answer is",a+b)
else:
print("invalid character")
Explanation:
this program is for python language ,if u want it for any other language ,you can comment
Similar questions
Math,
4 months ago
Geography,
4 months ago
Physics,
8 months ago
English,
8 months ago
Environmental Sciences,
1 year ago