01: #include <stdio.h>
02: #include <stdlib.h>
03: #include <time.h>
04:
05: int main (void)
06: {
07: int ans, user;
08: srand((unsigned) time(NULL));
09: ans = rand()%10;
10: printf("Your choice? [0-9]: ");
11: scanf("%d", &user);
12: if(ans == user)
13: {
14: printf("Bingo!\n");
15: }
16: else
17: {
18: printf("You lose.\n");
19: }
20:
21: return 0;
22: }