Write a program to input a number and if choice is I display its factorial and if choice is 2 display its primorial. Display an appropriate error message for an incorrect choice.
Sample input 1: number -5, choice -1
Output: Factorial of 5 is 120
Sample input 2: number 5, choice 2
Output: Primorial of 5 is 30
Sample input 3 number 5, choice - 3
Output: Invalid choice
Answers
Answered by
1
Explanation:
ANSWER
A program to input a number and if choice is I display its factorial and if choice is 2 display its primorial.
Sample input 1: number -5, choice -1
Output: Factorial of 5 is 120
Sample input 2: number 5, choice 2
Output: Primorial of 5 is 30
Sample input 3 number 5, choice - 3
Output: Invalid choice
Similar questions
Geography,
2 months ago
English,
2 months ago
History,
2 months ago
Math,
5 months ago
Computer Science,
5 months ago
Social Sciences,
1 year ago
English,
1 year ago
Math,
1 year ago