Sum Problem
#include<iostream>
using namespace std;
int main()
{
int i,n,sum = 0;
while(cin>>n)
{
for( i = 1 ; i <= n ; i++)
sum += i;
cout<< sum << endl<<endl;
sum = 0;
}
return 0;
}
Sum Problem
#include<iostream>
using namespace std;
int main()
{
int i,n,sum = 0;
while(cin>>n)
{
for( i = 1 ; i <= n ; i++)
sum += i;
cout<< sum << endl<<endl;
sum = 0;
}
return 0;
}