al-popov94

Game: Random number

Feb 19th, 2012
63
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×