Program needs to accept a positive integers greater than or equal to one,then store values into elements of an array/vector all while executing.
then add up the total of all the values within the elements and display.
#include <iostream>
using namespace std;
int i;
int main()
{
int n;
cout << "enter positive integer: ";
cin >> n;
if (n<1)
{cout <<"invalid input"<<endl;}
while (n >= 1)
{
for (i=1;i<=n;i++)
return 0;
}}