# help again

• 01-16-2007
neha007
help again
well friends i have to write a program which generates all combination of 1,2,3, plz give me some hints coz i have to submit it 17th jan
• 01-16-2007
laserlight
How would you methodically generate all the combinations by hand?
• 01-16-2007
swgh
Plan it out on paper like laserlight suggested. When you have the correct formular, ( use a calculator if it helps ) then write some puescode.
• 01-16-2007
neha007
will u plz give me some example
• 01-16-2007
manutd
No, we will not do your homework for you. Give it a try and post your non-working code.
• 01-16-2007
Sentral
Code:

```#include <iostream> using namespace std; int main() {       cout << "123" << endl;       cout << "132" << endl;       cout << "321" << endl;       cout << "312" << endl;       cout << "213" << endl;       cout << "231" << endl;             return 0; }```
lol...
• 01-16-2007
g4j31a5
Quote:

Originally Posted by Sentral
Code:

```#include <iostream> using namespace std; int main() {       cout << "123" << endl;       cout << "132" << endl;       cout << "321" << endl;       cout << "312" << endl;       cout << "213" << endl;       cout << "231" << endl;             return 0; }```
lol...

Yup, the manual way is the best way. :D :D :D
• 01-16-2007
laserlight
*cough* combination, not permutation *cough*
• 01-17-2007
manutd
So,
Code:

```#include <iostream> using namespace std; int main() {       cout << "123" << endl;       cout << "132" << endl;       cout << "213" << endl;       cin.get();       return 0; }```
• 01-17-2007
Salem
> plz give me some hints
Well do what laserlight suggested.

Like 123 is
1 + all combinations of 23
2 + all combinations of 13
3 + all combinations of 12

Rinse and repeat with some recursion - should be pretty obvious.
• 01-20-2007
neha007
thanx frnd
• 01-20-2007
iMalc
Quote:

Originally Posted by laserlight
*cough* combination, not permutation *cough*

Which would mean an answer would be more like this:
Code:

```#include <iostream> using namespace std; int main() {       cout << "" << endl;       cout << "1" << endl;       cout << "2" << endl;       cout << "3" << endl;       cout << "12" << endl;       cout << "13" << endl;       cout << "23" << endl;       cout << "123" << endl; }```
Of course I doubt he actually meant combination, as he didn't state how many items to pick, only what to pick from.