#include<stdio.h>
#include<conio.h>
void main()
{
int a[5] ;
int i , s;
clrscr();
printf(" Enter values in Array\n");
for(i=0 ; i<5 ; i++)
{
scanf(" %d" , &a[i] );
s = s + a[i] ;
}
printf(" Sum of all Array elements = %d" , s);
getch();
} /* End of main() */
Output:
Enter values in Array
22
10
20
11
15
Sum of all Array elements = 78
That's All
0 Response to "Write a Program (WAP) of C Language to Find out Sum of all Array elements"
Post a Comment