Created
November 8, 2013 14:09
-
-
Save snadahalli/7371547 to your computer and use it in GitHub Desktop.
C Program to find the number and sum of all integers from 100 to 200 which is divisible by 7.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********************************************************** | |
* You can use all the programs on www.c-program-example.com | |
* for personal and learning purposes. For permissions to use the | |
* programs for commercial purposes, | |
* contact info@c-program-example.com | |
* To find more C programs, do visit www.c-program-example.com | |
* and browse! | |
* | |
* Happy Coding | |
***********************************************************/ | |
#include<stdio.h> | |
int main() | |
{ | |
int i,a[20],sum=0,b[20],counter=0,num=100; | |
printf("The numbers between 100 and 200 which are divisible by 7 are:\n"); | |
for(i=100;i<=200;i++) | |
{ | |
if(i%7==0) | |
{ | |
sum=sum+i; | |
a[i]=i; | |
printf("\n"); | |
printf(" %d",i); | |
} | |
} | |
printf("\nThe sum of numbers divisible by seven is %d", sum); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment