Computer Science, asked by jhaayush580, 6 months ago

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 ssahildeep50
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