Skip to content
Question Bank (5 marks) · Q15

Q.Write a C program to print the sum of all even integers between 1 and 55

Karnataka PUCTextbookLong· 5mImportance★★★★★est
51% · 78/154 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

[!TLDR]

Loop over even numbers from 2 to 54 in steps of 2, adding them; the sum of even integers between 1 and 55 is 756.

The even integers between 1 and 55 are 2, 4, 6, ..., 54. A for loop starts at 2 and increases by 2 each time (i += 2) while i <= 55, adding each value to an accumulator sum.

#include <stdio.h>
int main()
{
    int i, sum = 0;
    for (i = 2; i <= 55; i += 2)
        sum += i; …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.