Question: Using C++, your main function should have the following: 1. Prompt the user to input a natural number n, determine nd display all the factors
Using C++, your main function should have the following:
1. Prompt the user to input a natural number n, determine nd display all the factors of n between 1 and n, in an increasing order, and then report how many factors n has in total whether n is a prime number or not. Declare a variable to count the number of non-trivial factors of n between 1 and n (i.e. natural numbers from 2 to n-1
2. Find and display every prime number less than or equal to 100 and determine in total how many prime numbers are less than or equal to 100. (You must have one loop nested inside anther loop)
3. Find and display the first 30 prime numbers. (Make sure to have one loop nested inside the another loop).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
