0

How to print random numbers of a certain range in C language???

How can i print random numbers within a range... i.e random numbers between (5-30) like that.. I am using c language but i guess the logic in other languages will be the same...any ideA?

11th Feb 2017, 2:33 PM
Aman Kumar Jha
Aman Kumar Jha - avatar
1 Antwort
+ 6
LOOP (for n times) PRINT (5 + (random_number % 26)) ENDLOOP // prints random number between 5 to 30 for n times.
11th Feb 2017, 2:38 PM
Hatsy Rei
Hatsy Rei - avatar