1. ## Newbie badly needs c++ help with looping!!!!

Ok, i am wanting to loop the code below so that it would do the function already in the program over and over once it is already done...ive tried looking at the tutorial, but i cant understand the lesson on loops very well...

Code:
```#include <iostream.h>

int mult(int x, int y);

int main()
{
int x, y;
cout<<"Please input two numbers to be multiplied: ";
cin>>x>>y;
cout<<"The product of your two numbers is "<<mult(x, y);
return 0;
}
int mult(int x, int y)
{
return x*y;
}```
Thanks in advance for any help!!!

2. do you mean you want:
Code:
```cout<<"Please input two numbers to be multiplied: ";
cin>>x>>y;
cout<<"The product of your two numbers is "<<mult(x, y);```
repeated say, 10 times? if so, here you go:

Code:
```#include <iostream.h>

int mult(int x, int y);

int main()
{
int x, y;
int i;

for (i=0;i<10;i++)
{
cout<<"Please input two numbers to be multiplied: ";
cin>>x>>y;
cout<<"The product of your two numbers is "<<mult(x, y) << endl;
}

return 0;
}

int mult(int x, int y)
{
return x*y;
}```
that will simply run the same operation of requesting two numbers, multiplying and printing, 10 times

hope that clears it up

3. I'm feeling generous today

for loop:

for(/*this is the initial value*/; /*this is the circumstance that terminates the loop*/; /*this is where you increment stuff*/)

for example:
Code:
```for(int i = 0; i < 256; i++) {

}```
means int i starts at zero and keep adding one to i until it hits 256.

while loop:

while(/*this is the circumstance that terminates the loop*/)

example:
Code:
```int i = 0;
while(i < 256) {
i++;
}```
meaning while i is less than 256 increment it.

4. ## For loop

now that you've learnt for loop...
here's a forever loop :-)
also called infinite loop... but i call it forever loop for giggles... :-)
PHP Code:
``` do {       cout << "Orey, elaagunnavu ?" ;       cin >> javaabu; }  while (1==1);  ```
while 1=1, this thing keeps repeating ..

COOL PROGRAMS @ www.akilla.tk

5. u can do it by tthe code below

if(m=0;m<100;m++){ doo something }

this means m is started from 0 and after every loop m is added 1 so this loop goes for 100 times not 99

6. hehe Heres a fun way to make an application break

for(m = 0; m < 100; m++) {
int x = (1 << m);
}

This is the sort of thing that compilers don't usually catch, and windows doesn't know how to handle.

Thus completes your lesson on how to make and break loops for today

7. it works fine.