How to find the even numbers square and sum from 1 to 10 in C Program

0
705

Even number is an integer, which is the multiple of two. In this program we use the for loop to produce the even numbers. Try to change the for loop limits you can get the various range results. Read more about C Programming Language .

/***********************************************************
* You can use all the programs for personal and learning purposes.
* For permissions to use the programs
*
***********************************************************/#include
#include
void main()
{
int i, j, sum = 0;
clrscr();
printf(“nEven numbers and their squares from 1 to 10:n”);
for(i =1; i  {
if(i % 2 == 0)
{
j = i * i;
printf(“%dtt%d”,i,j);
printf(“n”);
sum = sum + j;
}
}
printf(“nnSum of even numbers square from 1 to 10 is: %d”,sum);
getch();}