Code In Tech - The Ultimate World of Computer Technology

Tuesday, 27 March 2012

C program to Find total numbers which are divided by 7

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 unsigned int i,sum=0,count=0;
 clrscr();
 printf("\nthey are divided by 7:");
 for(i=101;i<=900;i++)
 {

  if(i%7==0)
  {
  sum=sum+i;
  count=count++;
  printf("%u ",i);
  }
 }
 printf("\nsum is %u",sum);
 printf("\n total num are %u",count);
 getch();
}

No comments :

Post a Comment