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
Science,
2 months ago
English,
2 months ago
Physics,
6 months ago
English,
6 months ago
Social Sciences,
10 months ago
Environmental Sciences,
10 months ago