Program Discussion :: Basics
7 / 279
Write a Program to generate random numbers.
Answer:
#include
#include
int main() {
int c, n;
printf("Ten random numbers in [1,100]\n");
for (c = 1; c
Asked In ::
Language:
Sumit
27 Oct, 2017 12:42 AM
#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;
}