#include"stdio.h"
#include"conio.h"
void main()
{
int i,x[10],tot=0;
clrscr();
printf("Enter 5 values\n");
for(i=1;i<=5;i++)
{
scanf("%d",&x[i]);
tot=tot+x[i];
printf("x[%d]=%d\n",i,x[i]);
}
printf("Total=%d",tot);
getch();
}
OUTPUT WILL BE
Enter 5 values
5 7 8 9 10
x[1]=5
x[2]=7
x[3]=8
x[4]=9
x[5]=10
Total=39
Google Ads
Friday, May 29, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment