Draw a flow chart and write an algorithm for a program that adds 10 even numbers starting from 2. (You must use looping).
Draw a flow chart and write an algorithm for a program that adds 10 even numbers starting from 2. (You must use looping).
1 Answers
Best Answer
/* 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();
}
[pdfjs-viewer url=”http%3A%2F%2Fdevelopnew.com/ignou%2Fwp-content%2Fuploads%2F2017%2F10%2FExamplelfFlowChart.pdf” viewer_width=100% viewer_height=560px fullscreen=true download=true print=true]