Advertisement
Tusohian

Random Number Function in C

Sep 21st, 2017
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.20 KB | None | 0 0
  1. #include<stdio.h>
  2. void main()
  3. {
  4.     srand( time(NULL) );
  5.     int i, ar[100];
  6.  
  7.     i=rand();
  8.  
  9.     for(i=0; i<10; i++)
  10.     {
  11.         ar[i]=rand()%100+100;
  12.         printf("%d\n", ar[i]);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement