Answers for "generate 3 random numbers in c"

C
0

how to generate random between 0 and 9 in c

#include <stdio.h>
#include <stdlib.h>

int main()

{
    int randomnumber;
    srand(time(NULL));
    randomnumber = rand() % 10;
    printf("%dn", randomnumber);
    return 0;
}
Posted by: Guest on May-17-2020
8

how to genrate a random number in C

#include <time.h>
#include <stdlib.h>

srand(time(NULL));   // Initialization, should only be called once.
int r = rand();      // Returns a pseudo-random integer between 0 and RAND_MAX.
Posted by: Guest on June-18-2020

Code answers related to "generate 3 random numbers in c"

Code answers related to "C"

Browse Popular Code Answers by Language