Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ASAP PLEASE PROGRAMMING LANGUAGE C++ A prime number is an integer that is greater than 1 and that is only evenly divisible by itself and
ASAP PLEASE
PROGRAMMING LANGUAGE C++
A prime number is an integer that is greater than 1 and that is only evenly divisible by itself and 1. For example, the number 5 is prime because it can only be evenly divided by 1 and 5. The number 6, however, is not prime because it can be divided evenly by 1, 2, 3, and 6. Write a function name isPrime, which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. Demonstrate the function in a complete program
OUTPUT SHOUL BE LIKE THIS :-
Enter an integer: !!! Invalid Input! Please re-enter: abc Invalid Input! Please re-enter: 1 Please enter an integer greater than one: Invalid Input! Please re-enter: -2 Please enter an integer greater than one: Invalid Input! Please re-enter: 2 It is a prime! Would you like to enter another number? yess Invalid input! Please re-enter: y Enter an integer: 9 9 is not a prime number. Would you like to enter another number? y Enter an integer: 11 It is a prime! Would you like to enter another number? n Application is terminating... Enter a file name for writing prime numbers: prime.txt What is the limit value you want to generate prime numbers? 100 The list of prime numbers up to the value 100 is: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started