C program to generate random numbers:
#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
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
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