the prime numbers from 1 to 2500 can be obtained as follows. From a list of the numbers of 1 to 2500,cross out al multiples of 2(but not 2 itself)Then, find the next number (n, say) that is not crossed out and cross out all multiples of n (but not
including n). Repeat this last step provided that n has not exceeded 50 (the square
root of 2500). The numbers remaining in the list (except 1) are prime. Write a
program which uses this method to print all primes from 1 to 2500. Store your
output in a file called primes.out.
Can someone please tell me how to go about doing this?