In need some homework help again. Please I am new at this and PLEASE PLEASE do not post YELLING post at me for wrapping the code because I don't know what that is. If you would like to explain it to me in plain english I am willing to learn.
Here goes I have to write a program taht uses a for structure to sum a sequence of integers. Assume that the first interger read specifies the number of values remaining to be entered. Here is what I came up with. How do I have the user of the program enter the number of values before the loop. Please help TY Jessie
#include<iostream>
using namespace std;
int main()
{
int i,s=0,x;
for(i=0;i<5;i++)
{
cout<<"Type an integer: ";cin>>x;
s=s+x;
}
cout<<"The sum is : "<<s<<endl;
return 0;
}