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
Social Sciences,
1 month ago
Biology,
1 month ago
Math,
3 months ago
Computer Science,
3 months ago
Social Sciences,
10 months ago
English,
10 months ago
Math,
10 months ago