Skip to content

Instantly share code, notes, and snippets.

@winhtut
Created August 8, 2019 07:10
Show Gist options
  • Save winhtut/0793299d6de040c1eee43e6e08339a46 to your computer and use it in GitHub Desktop.
Save winhtut/0793299d6de040c1eee43e6e08339a46 to your computer and use it in GitHub Desktop.
For dip Students
#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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment