Write A Program For Find the sum of array Elements

Posted on June 9, 2020June 13, 2020Categories C   Leave a comment on Write A Program For Find the sum of array Elements

#include<stdio.h># include<conio.h> void main() { int i,n,a[50],sum=0; clrscr(); printf(“Enter the total number of elements = “); scanf(“%d”,&n); printf(” Enter the value of all element : “); for(i=0;i<n;i++) { scanf(“%d”,&a[i]); sum=sum+a[i]; } printf(” Sum = %d”,sum); getch(); } Output: