Thanks:  0
Likes:  0
Dislikes:  0

# Thread: How to random condition integer numbers

1. ## How to random condition integer numbers

Hi there,

The target is to random create two integer numbers between 1 to 100, and the first one must be less than the second. What's the simplest command? Thanks in advance!

Chico

2. ## Re: How to random condition integer numbers

Hi,

\\Use RandInt function
int a,b
b= RandInt (1, 100)
a= RandInt (1, b)

3. ## Re: How to random condition integer numbers

Perfect!Thank you, Rajanish!

4. ## Re: How to random condition integer numbers

Not quite perfect; in the example above, "a" is NOT a random integer between 1 and 100. What you really want are merely 2 random numbers which are not equal; one will always be less than the other, you can call it the "first" one if you wish.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.