Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<stdlib.h>
  4.  
  5. int main(){
  6.  
  7. int game_status=0;
  8. int age=0;
  9. int number=0;
  10. printf("\t______welcome to our lottery game______\n\n");
  11. printf("\t1: Press 1 To Play Game!\n");
  12. printf("\t2: Press 2 To Quit Game!\n");
  13. scanf("%d",&game_status);
  14. if(game_status==1){
  15. printf("You can play game!\n");
  16.  
  17. while(1<2){
  18. printf("Please enter your age! Your age must be 18 or over:");
  19. scanf("%d",&age);
  20. while( age>17){
  21. printf("Please enter your lottery number :");
  22. scanf("%d",&number);
  23. if(number == 123){
  24. printf("you are win in lottery\n");
  25. }else{
  26. printf("try again\n");
  27. }
  28. }
  29. printf("age must be 18 or over\n");
  30. }
  31. }
  32. if( game_status==2){
  33. printf("Good Bye");
  34. exit(0);
  35. }
  36. getch();
  37. return 0;
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement