+ 1

Random double values in C

How to generate random double numbers in C? (Number like 12.38392)

11th Sep 2020, 2:42 AM
Krishan Shamod
2 odpowiedzi
+ 1
https://www.geeksforgeeks.org/rand-and-srand-in-ccpp/ Give this article a read through, It return a random integer but you could cast to double if you desire.
11th Sep 2020, 2:55 AM
StealthyTaco
StealthyTaco - avatar
+ 1
Divide rand() by 10^n, where n is the decimal.
11th Sep 2020, 3:08 AM
你知道規則,我也是
你知道規則,我也是 - avatar