Question: answer all in C++ 1. Write a program in C++ to find the factorial of a number. Input a number to find the factorial: 5
1. Write a program in C++ to find the factorial of a number. Input a number to find the factorial: 5 The factorial of the given number is: 120 The factorial is calculated by multiplying the original number by all the positive integers smaller than itself. Thus the factorial of 5 is 54321, or 120 . 2. Write a program in C++ to check whether a number is prime or not. Sample Output: Input a number to check prime or not: 13 The entered number is a prime number. A prime number is a positive integer with only two factors: itself and one. 3. Write a program in C++to check whether a number is prime or not. Ask user if they want to check again. And stop loop if they do not want to check. Sample Output: Input a number to check prime or not: 13 The entered number is a prime number. Do you want to check more number? Press Y for yes or any other key to exit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
