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? 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; Link to comment https://forums.phpfreaks.com/topic/177205-solved-random-range-c/#findComment-934369 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.