Tech Support Forum banner

Rand function not random

2146 Views 1 Reply 2 Participants Last post by  jamiemac2005
Hey guys,
i was tying some simple programs in c++ when i came across rand function in two programs.it should generate a totally new number every time.but my complier,which is ,DEV C++,generates the number 41 everytime.i tried restarting the complier but it did the same.
also my complier highlights all known functions but this time it did not highlight rand().I had included the <cstdlib> header.also when the output is to be generated i have to ALWAYS include the command cin.get() to keep the command prompt window open
PLEASE suggest solutions
THANKS IN ADVANCE
Status
Not open for further replies.
1 - 1 of 2 Posts
1 - 1 of 2 Posts
Status
Not open for further replies.
Top