18.Write a program in c to calculate the sum of all prime numbers between two given numbers using a for loop.
Description
This program takes a range and finds all the prime numbers in the range and also prints the total number of prime numbers.
Solution
1. Take as input the range of numbers in which you want to find prime numbers.
2. Test prime numbers only against odd numbers in the range.
3. Also check if the natural numbers are divisible by any of the odd numbers starting from 2.
4. Print the prime numbers and its count.
5. Exit.