The following code shows how to Find the Sum of All Prime Numbers in the Given Range in C.

// Find Whether a Number is Prime or Not

#include <stdio.h>

int main()
{
    int low, high, i, j, prime=1, primesum=0;
    printf("Enter the lower value limit of the range: ");
    scanf("%d", &low);
    printf("Enter the higher limit of the range: ");
    scanf("%d", &high);
    printf("Prime Numbers in the Range [%d, %d] are...\n", low, high);
    for(j=low;j<=high;j++){
        for(i=2;i<=j/2;i++)
       {
          if(j%i==0)
          {
            prime=0;
            break;
          }
       }
      if(prime)
      {
          printf("%d ", j);
          primesum+=j;
      }
      prime=1;
    }
    printf("\nSum of all prime numbers in the range [%d, %d] is %d\n\n", low, high, primesum);
    return 0;
}

Output

The Output of the Program to Find the Sum of All Prime Numbers in the Given Range in C
The Output of the Program to Find the Sum of All Prime Numbers in the Given Range in C

Further Reading

50+ C Programming Interview Questions and Answers

C Program to Find Factorial of a Number