seventheyejosh Posted October 10, 2009 Share Posted October 10, 2009 How can I make a random range in C++? I know something like this : choice=(rand()%6)+1; will give me 1 - 6, but how do I go from say, 100 - 200 only? Quote Link to comment https://forums.phpfreaks.com/topic/177205-solved-random-range-c/ Share on other sites More sharing options...
seventheyejosh Posted October 10, 2009 Author Share Posted October 10, 2009 nvmd... cout << (rand()%(end-start+1))+start; Quote Link to comment https://forums.phpfreaks.com/topic/177205-solved-random-range-c/#findComment-934369 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.