Advertisement
ThetOo

Lottery Error

Mar 7th, 2020
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main() {
  4.     int age=0;
  5.     int id=0;
  6.     int amount=0;
  7.     int number=0;
  8.     int num=0;
  9.     int smoney=0;
  10.     int mmoney=0;
  11.     int rmoney=0;
  12.     int all=0;
  13.     printf("$$ Welcome Our Lottery $$\n\n");
  14.     printf("Enter Your Age :");
  15.     scanf("%d",&age);
  16.    
  17.     if(age>17)
  18.     {
  19.         printf("Enter Your Show Money :");
  20.         scanf("%d",&smoney);
  21.         printf("This is Your Money :%d\n",smoney);
  22.         while(age>17){
  23.             printf("Enter Your ID :");
  24.             scanf("%d",&id);
  25.             while(id<100)
  26.             {
  27.                 printf("Start Game\n");
  28.                 printf("Enter Your Amount :");
  29.                 scanf("%d",&amount);
  30.                 while(amount>999)
  31.                 {
  32.                     printf("Choice Your Lucky Number :");
  33.                     scanf("%d",&number);
  34.            
  35.                     if(number==111)
  36.                     {
  37.                         rmoney=amount*10;
  38.                         all=mmoney+rmoney;
  39.                         printf("This is Your All Money : %d\n",all);
  40.                         printf("Congratulation You Win\n");
  41.                         printf("Press 1 to Play Again\n");
  42.                         printf("Press 2 to Exit Game!\n");
  43.                         scanf("%d",&num);
  44.                         if(num==1)
  45.                         {
  46.                             printf("Play Again!\n");
  47.                         }else
  48.                         {
  49.                             printf("See You Again!");
  50.                             exit(0);
  51.                         }
  52.                     }else
  53.                     {
  54.                         printf("You Lose, Try Again!\n");
  55.                         mmoney=smoney-amount;
  56.                         printf("This is Your M Money :%d\n",mmoney);
  57.                         if(mmoney<1000)
  58.                         {
  59.                             printf("You Can't Play!");
  60.                             exit(0);
  61.                         }
  62.                     }
  63.                 }
  64.             }
  65.             }
  66.     }else
  67.     {
  68.         printf("You Can't Play This Game!");
  69.     }
  70.    
  71.    
  72.    
  73.     return 0;
  74.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement