c++ program to find prime numbers:
The problem of finding prime number can be solved by checking all numbers, testing them for prime and then moving ahead. If you want to calculate nth prime. Then this can be done in a brutal way by checking the number one by one. This may sound odd, by there is no easy way then this for prime numbers (Well Actually there are like Pollard's Rho Algorithm, Number Sieves or Shor's Quantum Algorithm, but we are talking about the one that most people may understand easily). There may be way to pre-calculate the prime numbers but that again is not sufficient. So how can we use c++ to create a program to find prime numbers.
The problem of finding prime number can be solved by checking all numbers, testing them for prime and then moving ahead. If you want to calculate nth prime. Then this can be done in a brutal way by checking the number one by one. This may sound odd, by there is no easy way then this for prime numbers (Well Actually there are like Pollard's Rho Algorithm, Number Sieves or Shor's Quantum Algorithm, but we are talking about the one that most people may understand easily). There may be way to pre-calculate the prime numbers but that again is not sufficient. So how can we use c++ to create a program to find prime numbers.