Best collection of C programs
Tuesday, January 4, 2011
SUM OF ARRAY
WAP TO SUM OF FIVE ELEMENTS OF AN ARRAY
void main ()
{
int no[5],i,sum;
clrscr ();
for (i=0;i<=4;i++)
{
printf ("Enter Element: ");
scanf ("%d",&no[i]);
}
sum=no[0]+no[1]+no[2]+no[3]+no[4];
printf ("\nSum of five Elements: %d",sum);
getch ();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment