C Exercises: Sum of n odd numbers starting from m
Compute sum of nnn odd numbers starting from mmm
Write a C program that reads two integers m, n and computes the sum of n odd numbers starting from m.
Sample Solution:
C Code:
Sample Output:
Input two integes (m, n): 65 5 Sum of 5 odd numbers starting from 65: 345
Flowchart:

For more Practice: Solve these Related Problems:
- Write a C program to calculate the sum of n consecutive odd numbers starting from m using a loop.
- Write a C program to generate the odd number sequence starting from m and compute their sum with a for-loop.
- Write a C program to accumulate the sum of n odd numbers using recursion from a starting value m.
- Write a C program to compute the sum of odd numbers using the arithmetic series formula after generating the sequence.
C programming Code Editor:
Previous: Write a C program that reads two integers m, n and compute the sum of n even numbers starting from m.
Next: Write a C program that reads an array of integers (length 7), replace every negative or null element by 1 and print the array elements.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.