int sum;
sum=0;
int counter;
int number1;
number1=1;
counter=1;
//Declare variable for which user enters the first n numbers to find their sum
int n;
//Tell user for first n numbers
cout<<"First N Numbers: ";
cin>>n;
while (counter>=0 && counter<=n)
{
sum=number1+counter;
number1=counter;
sum=sum +number1+counter;
counter++;
}
cout<<"\n\n\tSum of first n number is: " <<sum;
_getch();