So what is your question ??
What is a loop??
A loop is a group of statements that get called multiple times
e.g.
for(int i=0;i<10;i++)
{
// statements here
}
which calls the statements 10 times
or
while(x>18)
{
// Statements here
}
which calls the statements until x > 18. Note that if x is already
you don't get to run the statements in the loop.
There are other loop constructs, but for now: Write some code.
I would not try to do you assignment straight away, write a set of little test programs, e.g. print the number 1 to 10, then add them up.
then read a number from the keyboard etc. Post some code here, with a comment about what you can/can't understand and you will get a bit more useful feedback.
Note: We are not going to do you homework for you, but will help if you show effort.
StuXYZ
Practically a Master Poster
680 posts since Nov 2008
Reputation Points: 760
Solved Threads: 138