Write a C program to find the sum of first 10 even numbers

#include<stdio.h>
int main()
{
int a,b,c;
b=0;
for(a=1;a<=10;a++)
b=b+(a*2);
printf("sum of the first 10 even numbers is %d\n",b);
return 0;
}

Post a Comment

1 Comments