Computer Science, asked by charanbhc, 9 months ago

Write a C function that calculates the sum of integers between 9 and 300 inclusive
which are divisible by 7 but not divisible by 63.
Expected output: sum of integers between 9 and 300 that are divisible by 7 but not by
63 is 5684

Answers

Answered by coffeebiscuits
6

int calcsum()

{

     int sum = 0;

     int i = 9;

     while(i <= 300)

     {

           if(i % 7 == 0 && i % 63 != 0)

           {

                  sum += i;

           }

           i++;

     }

     return i;

}

Similar questions