Computer Science, asked by rockingstar16, 1 year ago

write a program to print first 10 even numbers.

Answers

Answered by piyush2272
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();

}


rockingstar16: can u sent a simple program
piyushatre29: inappropriate answer...bro...
piyush2272: hmmm
piyushatre29: copy paste kiya na..bhot shi..good luck
Answered by piyushatre29
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


rockingstar16: bro I asked first 10 even numbers not first 20 even numbers
piyushatre29: bro..if u run then u will get the output...as your 10 even number..but as your wish i modified it for your better understanding
rockingstar16: Thanks
piyushatre29: thANks bro.. if u satisfied then please mark me as brainleist
Similar questions