Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions

Question

Write the properties of Group theory.

Answered: 1 week ago

Question

How is slaked lime powder prepared ?

Answered: 1 week ago

Question

Why does electric current flow through acid?

Answered: 1 week ago

Question

What is Taxonomy ?

Answered: 1 week ago