Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

PROGRAM TO FIND SUM OF ALL INTEGER WHICH IS > 100 AND< 200 AND WHICH IS DIVISIBLE BY 7

Posted By: Rachel Fischer     Category: C Programming     Views: 14165

PROGRAM TO FIND SUM OF ALL INTEGER WHICH IS > 100 AND< 200 AND WHICH IS DIVISIBLE BY 7.

Code for PROGRAM TO FIND SUM OF ALL INTEGER WHICH IS &gt; 100 AND&lt; 200 AND WHICH IS DIVISIBLE BY 7 in C Programming

include<stdio.h>
#include<conio.h>

void main()
{
    int i,sum = 0;
    clrscr();

    for(i = 100;i <= 200 ; i++)
    {
        if (i % 7 == 0)
        sum = sum + i;
    }
    printf("\n Sum of all no between 100 and 200 ");
    printf("which is divisible by 7 is :: %d",sum);
    getch();
}


/*
**********
OUTPUT
**********

Sum of all no between 100 and 200 which is divisible by 7 is :: 2107
*/
  
Share: 



Rachel Fischer
Rachel Fischer author of PROGRAM TO FIND SUM OF ALL INTEGER WHICH IS > 100 AND< 200 AND WHICH IS DIVISIBLE BY 7 is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!