PPA-10
Question
Accept a positive integer \(n\) as input and print the sum of all prime numbers in the range \([1, n]\), endpoints inclusive. If there are no prime numbers in the given range, then print 0.
Hint
You already know how to find if a number is prime or not. Refer to PPA-4 if you have forgotten this. Now, all that you need is a nested loop, where you go over all numbers in the given range, check if each one is a prime or not, and just add those numbers that are primes.