Q1 Write a menu driven program which has following options: 1. Factorial of a number 2. Prime or not 3. Odd or even 4. Exit Once a menu item is selected the appropriate action should be taken and once this action is finished, the menu should reappear. Unless the user selects the ‘Exit’ option the program should continue to run.
Program: 120
Write a menu driven c program which has following options:
- Factorial of a number
- Prime or not
- Odd or even
- Exit
Once a menu item is selected the appropriate action should be taken and once this action is finished, the menu should reappear. Unless the user selects the ‘Exit’ option the program should continue to run.
Output:
1. Factorial of a number 2. Prime or not 3. Odd or even 4. Exit Enter your choice:1 Enter an integer: 5 Factorial of 5 is 120. 1. Factorial of a number 2. Prime or not 3. Odd or even 4. Exit Enter your choice:2 Enter an integer: 5 5 is Prime Number. 1. Factorial of a number 2. Prime or not 3. Odd or even 4. Exit Enter your choice:3 Enter an integer: 5 5 is Odd Number. 1. Factorial of a number 2. Prime or not 3. Odd or even 4. Exit Enter your choice:4 Exit