Advertisement
al-popov94

Game: Random number

Feb 19th, 2012
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. /* al.popov94@gmail.com */
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. main()
  7. {
  8.     int num, ent; /* num - random number, ent - enter number */
  9.  
  10.     printf("Game: Random number!\n");
  11.  
  12.     while(num != ent) {
  13.     printf("\nTry again.\n");
  14.     num = rand()%10;
  15.     /* printf("\n# Cheate - %d #\n", num); */
  16.     printf("Enter number: ");
  17.     scanf("%d", &ent);
  18.     }
  19.  
  20.     printf("Congratulate! You have guessed.\n");
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement