About 204,000 results
Open links in new tab
  1. How to generate a random int in C? - Stack Overflow

    Basically, the computer can generate random numbers based on the number that is fed to srand(). If you gave the same seed value, then the same random numbers would be …

  2. I need to generate random numbers in C - Stack Overflow

    Jul 28, 2009 · This is the simplest method of producing uniformly distributed random numbers in C: Step 1. Be sure to include the standard library header to get the necessary function …

  3. Generating random numbers in C - Stack Overflow

    Jun 18, 2010 · $ gcc -W -Wall rand.c rand.c: In function `main': rand.c:5: error: too many arguments to function `rand' rand.c:6: warning: implicit declaration of function `printf' You get …

  4. generate a random number between 1 and 10 in c - Stack Overflow

    Jul 25, 2013 · Random number generators are only "random" in the sense that repeated invocations produce numbers from a given probability distribution. Seeding the RNG won't …

  5. How to generate a random number in C++? - Stack Overflow

    Nov 19, 2012 · The overall interface of std::rand() isn't very intuitive for the proper generation of pseudo-random numbers between a given range, e.g., producing numbers between [1, 6] the …

  6. How do I generate a random integer in C#? - Stack Overflow

    Try these simple steps to create random numbers: Create function: private int randomnumber(int min, int max) { Random rnum = new Random(); return rnum.Next(min, max); } Use the above …

  7. c - How do I get a specific range of numbers from rand ... - Stack …

    Jul 30, 2009 · Q: How can I get random integers in a certain range? A: The obvious way, rand() % N /* POOR */ (which tries to return numbers from 0 to N-1) is poor, because the low-order bits …

  8. How to generate a random integer number from within a range

    Apr 3, 2018 · Perhaps the most expedient is to define a function random_extended() that pulls n bits (using random_at_most()) and returns in [0, 2**n), and then apply random_at_most() with …

  9. How to generate random float number in C - Stack Overflow

    Nov 16, 2012 · Some rounding is actually necessary: if you want to generate uniform float value over [0..1], but still have a chance to generate every representable float, you need multiple …

  10. c - How do I generate random numbers without rand() function?

    I want to generate (pseudo) random numbers between 0 and some integer. I don't mind if they aren't too random. I have access to the current time of the day but not the rand function. Can …

Refresh