Code In Tech - The Ultimate World of Computer Technology

Saturday, 24 March 2012

C program to Find sum of 100 numbers

SOURCE CODE: 
#include<stdio.h>
#include<conio.h>
void main()
{
 int i,sum=0,count=0;
 clrscr();
 for(i=101;i<=200;i++)
 {
  if(i%7==0)
  {

  sum=sum+i;
  count=count++;
  }
 }
 printf("sum is %d",sum);
 printf("\n total num are %d",count);
 getch();
}

No comments :

Post a Comment