# C program to find Sum of Prime Numbers between 1 to n given by range

```
#include<stdio.h>
int main()
{
int start, end, temp, i, j, flag, sum=0;
printf("Enter Start number: ");
scanf("%d",&start);
printf("Enter End number: ");
scanf("%d",&end);
if(start == 1)
{
temp = start + 1; //temp for store value by 1 because any prime number is 1 and it self
}
/* Find all prime numbers between 1 to enter by user number */
for(i=temp;i<=end;i++)
{
flag = 1; //initialize flag 1
//check current number i is a prime or not
for(j=2;j
```

**Output**

```
Enter Start number: 12
Enter End number: 22
Sum of all Prime Numbers between 12 to 22 = 78
```