a.) this code was a free source from online [ not mine / cannot take credit ]
b.) you enter in how many numbers you want to add up [ example 5 ]
c.) then you enter in your 5 numbers and the prog. adds them up for you
d.) - - here is where my question comes in - - inside of the for ( )
statement / integer i = 0 [ understood ] / then i<numberitems .......
* is this read as i is less than numberitems ? i'm assuming yes / 0<5
* then, what does that nasty i++ do ??
#include<iostream>
usingnamespace std;
int main ()
{
int sum = 0;
int number;
int numberitems;
cout << "Enter number of items: \n";
cin >> numberitems;
for(int i=0;i<numberitems;i++)
{
cout << "Enter number: \n";
cin >> number;
sum=sum+number;
}
cout << "\n" << "\n";
cout<<"the sum is: "<< sum<<endl;
}