Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<conio.h>
- #include<stdlib.h>
- int main(){
- int game_status=0;
- int age=0;
- int number=0;
- printf("\t______welcome to our lottery game______\n\n");
- printf("\t1: Press 1 To Play Game!\n");
- printf("\t2: Press 2 To Quit Game!\n");
- scanf("%d",&game_status);
- if(game_status==1){
- printf("You can play game!\n");
- while(1<2){
- printf("Please enter your age! Your age must be 18 or over:");
- scanf("%d",&age);
- while( age>17){
- printf("Please enter your lottery number :");
- scanf("%d",&number);
- if(number == 123){
- printf("you are win in lottery\n");
- }else{
- printf("try again\n");
- }
- }
- printf("age must be 18 or over\n");
- }
- }
- if( game_status==2){
- printf("Good Bye");
- exit(0);
- }
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement