Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write an algorithm and a program that finds and prints all of theprime numbers b

ID: 3616699 • Letter: W

Question

Write an algorithm and a program that finds and prints all of theprime numbers between 3 and 100. A prime number is a numbersuch that one and itself are the only numbers that evenly divideit. (3,5,7,...)
This is a hint from the question: One way to solve this problem is to use a double nested loop. The outer loop can iterate from 3 to 100 while the inner loopchecks to see if the counter value for the outer loop is prime. One way to see if the number n is prime is to loop from 2 ton-1 and if any of those numbers evenly divides n, then n cannot beprime. If none of the values from 2 to n-1 evenly divide n,then n must be prime. (Note that there are several easy waysto make this algorithm more efficient.)
This is a hint from the question: One way to solve this problem is to use a double nested loop. The outer loop can iterate from 3 to 100 while the inner loopchecks to see if the counter value for the outer loop is prime. One way to see if the number n is prime is to loop from 2 ton-1 and if any of those numbers evenly divides n, then n cannot beprime. If none of the values from 2 to n-1 evenly divide n,then n must be prime. (Note that there are several easy waysto make this algorithm more efficient.)

Explanation / Answer

please rate - thanks #include using namespace std; void print_prime(int,int); int main() {print_prime(3,100); system("pause"); return 0; } void print_prime(int min,int max) {int i,j,factors; for(j=min;j
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote