Question: Needed a Flowchart for the following program. A prime number is a natural number greater than 1 that has no positive divisors other than 1

Needed a Flowchart for the following program.

A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. A natural number greater than 1 that is not a prime number is called a composite number. Create a FLOW CHART for C++ program that utilizes nested for loop that asks the user for a number then the program should compile a list of all natural numbers from 2 to the number the user keyed in marking with a star the prime numbers only.

1. Asks the user for number.

2. List all numbers from 2 to the user typed number.

3. Mark the Prime number with a stars leaving the composite numbers not labeled.

4. Stars should increment keeping track of the prime numbers found previously.

5. In case no Prime numbers is found your program should notify the user.

6. Make sure to check your program for values over 180.

This program works fine but I needed a one without the use of "string" and other library. If you can help me in that too.

Here is the program:

#include #include

int main() { std::string again= "y"; while(again=="y"){ int num; std::cout << " PLEASE ENTER A NUMBER : "; std::cin>>num; if(num<0){ std::cout<<"Negative numbers can't be prime, try using positive! "; } int count = 0; for(int i=2;i<=num;i++){ bool isPrime=true; for(int j=2;j>again; } std::cout<<" Thank you goodbye..... "; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!