I want to know a small c code to generate random numbers.It could be within a certain range.
I want to know if rand() function will generate a random number
vardhani
0
Newbie Poster
Recommended Answers
Jump to Postthere's no such thing as a random number.
num = rand();
will return a "pseudo-random" number over the interval between 0 and 2^32, depending on your compiler.
not truly random, but i suspect that it will have enough "appearance" of being random for your purposes.
Jump to PostI want to know a small c code to generate random numbers.It could be within a certain range.
I want to know if rand() function will generate a random numberYes,
rand()
will generate a random number. Also, look up thesrand()
function which you will also need.Then …
Jump to Postokay, yes, that's all well and good but as you'll see there's a perfectly reasonable explanation as to why I ...
oh, look. the Queen!
All 10 Replies
jephthah
1,888
Posting Maven
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
jephthah
1,888
Posting Maven
Narue
5,707
Bad Cop
Team Colleague
jephthah
1,888
Posting Maven
WaltP
commented:
OK -- enough. You aren't making your point so drop it.
-2
Narue
5,707
Bad Cop
Team Colleague
DavidB
44
Junior Poster
jephthah
1,888
Posting Maven
Narue
5,707
Bad Cop
Team Colleague
jephthah
1,888
Posting Maven
Aia
commented:
Long live the Queen. Hehe
+7
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.