write a program to print first 10 even numbers.
Answers
Answered by
1
/* QN 5 FIRST 10 EVEN NUMBER AND THEIR SUM */
#include<stdio.h>
#include<conio.h>
void main()
{ int i,n,t=0,sum=0;
clrscr();
printf("First 10 even number is:\n");
for (i=1;i<=10;i++)
{ t+=2;
printf("%4d",t);
sum +=t;
}
printf("\n\nThe sum of = %d\n",sum);
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{ int i,n,t=0,sum=0;
clrscr();
printf("First 10 even number is:\n");
for (i=1;i<=10;i++)
{ t+=2;
printf("%4d",t);
sum +=t;
}
printf("\n\nThe sum of = %d\n",sum);
getch();
}
rockingstar16:
can u sent a simple program
Answered by
1
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr():
int i,even=0;
printf("\nfirst 10 even number is");
for(i=1;i<=10;i++)
{even=even+2;
printf("\n%d",even);}
getch();
}
i hope it will help u..
for more satisfieng answers of query on c and c language
please mark me as brainleist
Similar questions