Solution:
#include <stdio.h>
int main()
{
int arr[10];
int sum,i;
printf("\nEnter elements : \n");
for(i=0; i<10; i++)
{
printf("Enter arr[%d] : ",i);
scanf("%d",&arr[i]);
}
sum=0;
for(i=0; i<10; i++)
{
sum=sum+arr[i];
}
printf("\nSum of array is : %d" ,sum);
return 0;
}
0 Comments