Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You will be creating a main() function and an isPrime function to practice functions, loops, and basic outputs. You will submit ONE file on Canvas
You will be creating a main() function and an isPrime function to practice functions, loops, and basic outputs. You will submit ONE file on Canvas called LastName_Firstname_HW2B.cc (or .cpp). Instructions: 1. Prompt a user to type in a positive integer from the keyboard. 2. Write a function called isprime that returns true if the number is prime and false if it is not. The isPrime function will be of bool data type. 3. Output your result to include what number was tested and the result. Example output: Please enter a positive integer: *User enters 2753 The number 2753 is: PRIME Please enter a positive integer: *User enters 4000000* The number 4000000 is: NOT PRIME
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