Guest User

random numbers, nonfuctional, always same results

a guest
Oct 26th, 2013
177
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. #include <stdlib.h>
  3.  
  4. int genRand()
  5. {
  6.     return rand()%2+0;
  7. }
  8.  
  9. int main()
  10. {
  11.     int i;
  12.  
  13.     for(i=0;i<=100;i++)
  14.     {
  15.     printf("%d\n",genRand());
  16.     }
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment