Horje
random number between 2 in C Code Example
random number between 2 in C
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main()
{
    int lower = 1, upper = 6, count = 10;

    srand(time(0));

    printf("The random numbers are: ");
    for (int i = 0; i < count; i++) {
        int num = (rand() % (upper - lower + 1)) + lower;
        printf("%d ", num);
    }

    return 0;
}




C

Related
Which of the following are Cetaceans? Code Example Which of the following are Cetaceans? Code Example
octave square each element matrix Code Example octave square each element matrix Code Example
zizag c Code Example zizag c Code Example
'&&' within '||' Code Example '&&' within '||' Code Example
how to use gets after scanf Code Example how to use gets after scanf Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
13