# question how to do this?

Page 1 of 1

## 3 Replies - 137 Views - Last Post: 08 September 2012 - 05:52 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=291297&amp;s=de895202a76302b64b91120cc24ab742&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 devil19xp

Reputation: -5
• Posts: 9
• Joined: 08-September 12

# question how to do this?

Posted 08 September 2012 - 04:04 AM

```#include <iostream>

using namespace std;

int main()
{
//how to make all the output
//in increasing order a,b,c,d where "a" will be smaller than "b"
//and "b"  smaller  than "c";
for(int a=1;a<30;a++ ){ //for example in this format (a< b),(b<c),(c<d),(d)
for(int b=2;b<40;b++ ){ //    example the output 2,4,7,18
for(int c=4;c<50;c++ ){    // where "2" is smaller than "4"
for(int d=10;d<66;d++ ){ //"4" is smaller than "7"
cout<<a<<","<<b<<","<<c<<","<<d<<endl;//"7" is smaller than "18"
}
}
}
}
return 0;
}
```

This post has been edited by Salem_c: 08 September 2012 - 04:08 AM
Reason for edit:: added [code][/code] tags - learn to use them yourself

Is This A Good Question/Topic? 0

## Replies To: question how to do this?

### #2 Salem_c

• void main'ers are DOOMED

Reputation: 1418
• Posts: 2,681
• Joined: 30-May 10

## Re: question how to do this?

Posted 08 September 2012 - 04:11 AM

Like this?
```for(int a=1;a<30;a++)
for(int b=a+1;b<30;b++)

```

### #3 devil19xp

Reputation: -5
• Posts: 9
• Joined: 08-September 12

## Re: question how to do this?

Posted 08 September 2012 - 04:37 AM

it didnt work...

Salem_c, on 08 September 2012 - 04:11 AM, said:

Like this?
```for(int a=1;a<30;a++)
for(int b=a+1;b<30;b++)

```

it didnt work...

### #4 no2pencil

• Original Digital Gansta

Reputation: 4463
• Posts: 24,908
• Joined: 10-May 07

## Re: question how to do this?

Posted 08 September 2012 - 05:52 AM