Q:

C program to generate random numbers:

0

C program to generate random numbers:

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <stdio.h>

#include <stdlib.h>

int main()

{

int i, n;

printf(“Five random numbers between 1 and 100000\n”);

for (i = 1; i <= 5; i++)

{

n = rand()%100000 + 1;

printf(“%d\n”, n);

}

return 0;

}

Output:

Five random numbers between 1 and 100000

89384

30887

92778

36916

47794

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now