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
Science,
4 days ago
Math,
8 days ago
Computer Science,
8 days ago
Social Sciences,
7 months ago
English,
7 months ago
Math,
7 months ago