Write a program that prints out the first n primes, and n is input by the user. Example as follows:
How many do you want to see? 3000
Program should be written in three files:
Attached are parts of two files (primes.h, is_primes.c)
Explain how is_prime() works. Complete the program by writting main() in main.c. There are 168 primes that are less than 1000. Does the program confirm this? How many primes are there that are less than 10,000?© BrainMass Inc. brainmass.com October 24, 2018, 10:27 pm ad1c9bdddf
Functionality of is_prime function is expressed in following steps.
1. Check whether the argument number (n) is 2. If it is 2 (first prime number) then return 1.
2. Check if n is a multiple of 2. If "n modulus 2" is 0, then n is a multiple of 2 and so it can not be a prime number. Function returns 0 in this ...
C code in solution assumes fair input to the program and has been tested for compilation with "gcc -Wall -ansi main.c is-prime.c", and for execution with inputs in the set (0-5, 168-170, 1230, 10000).
Programming Using C++
Please help with the following problem.
Write a program that computes and prints the 1000th prime number using code blocks c++.
a. You will need some variables to keep track of which prime number you're on and keep track of where you are in your loop.
b. Need to test odd numbers to see if they are prime..
c. Need two loops