#include <iostream>
using namespace std;
main()
{
int N,i,sum=0;
cout<<"Enter the size of the array\n";
cin>>N;
int arr[N];
cout<<"Enter "<<N<<" Numbers\n";
for(i=0;i<N;i++)
{
cin>>arr[i];
sum=sum+arr[i];
}
cout<<"The Sum of the elements of the array is: "<<sum;
}
No comments:
Post a Comment