programming-examples/c/Functions/C program to generate random numbers..c

14 lines
257 B
C
Raw Normal View History

2019-11-15 12:59:38 +01:00
#include <stdio.h>
#include <stdlib.h>
int main()
{
int c, n;
printf("Ten random numbers in [1,100]\n");
for (c = 1; c <= 10; c++)
{
n = rand() % 100 + 1;
printf("%d\n", n);
}
return 0;
}