#include<stdio.h>
#include<conio.h>
main ()
{
clrscr();
int a=1,b,sum;
while (a<=100)
{
sum=0;
for (b=1; b<=a+9; b++)
{
sum=sum+b;
printf("Sum is %d.\n", sum);
}
a=a+20;
b=a;
}
getch();
return(0);
}
-This code is supposed to print the sum of the first 100 words. Getting the sum of the first ten, skipping the next ten, adding the next ten, and so on.
It's like this:
1+2+3+4+5+6+7+8+9+10 (skip 11-20) +21+22+23+24+25+26+27+28+29+30 (skip 31-40) ...