Computer Science, asked by keerthanacskfan, 3 months ago

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