WAP TO SUM OF FIVE ELEMENTS OF AN ARRAY
Thursday, July 2, 2009
Leave a Comment
#include<stdio.h>
#include<conio.h>
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 the five Elements: %d",sum);
getch ();
}
OUTPUT
Enter Element: 12
Enter Element: 21
Enter Element: 34
Enter Element: 25
Enter Element: 50
Some of the five elements: 142
0 comments »
Leave your response!