#include<iostream>
using namespace std;
int main()
{
int n, *a, sum = 0, i;
cout << "Enter A Value : ";
cin >> n;
a = new int[n];
cout << endl;
for(i=0;i<n;i++)
{
cin >> a[i];
sum = sum + a[i];
}
cout << endl << "Summation is : " << sum << endl;
delete []a;
return 0;
}
using namespace std;
int main()
{
int n, *a, sum = 0, i;
cout << "Enter A Value : ";
cin >> n;
a = new int[n];
cout << endl;
for(i=0;i<n;i++)
{
cin >> a[i];
sum = sum + a[i];
}
cout << endl << "Summation is : " << sum << endl;
delete []a;
return 0;
}
Comments
Post a Comment