C Exercises: Sum all numbers between two given numbers (inclusive) not divisible by seven
Sum numbers between two integers, skipping those divisible by 7
Write a C program to calculate the sum of all numbers between two given numbers (inclusive) not divisible by 7.
Sample Solution:
C Code:
Sample Output:
Input two numbers(integer): 25 5 Sum of all numbers between said numbers (inclusive) not divisible by 7: 273
Sample Output:
Input two numbers(integer): 6 36 Sum of all numbers between said numbers (inclusive) not divisible by 7: 546
Flowchart:

For more Practice: Solve these Related Problems:
- Write a C program to compute the sum of all numbers between two integers while skipping numbers divisible by 7 using a loop.
- Write a C program to iterate over a range and sum numbers not divisible by 7, using the modulus operator for checks.
- Write a C program to compute the sum with a conditional that skips multiples of 7 and prints the final total.
- Write a C program to use a function to sum numbers in a range and exclude those divisible by 7, then display the result.
C programming Code Editor:
Previous: Write a C program that reads five subject marks (0-100) of a student and calculate the average of these marks.
Next: Write a C program to print a sequence from 1 to a given (integer) number, insert a comma between these numbers, there will be no comma after the last character.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.