Kimossab

Random Number 1-7

Dec 19th, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.19 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. void main()
  6. {
  7.     srand(time(NULL));
  8.     for(int i=0; i<7; i++)
  9.         printf("%d ", (rand() % 7)+1);
  10.     printf("\n%d\n", (rand()%7) + 1);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment