Wednesday, September 22, 2010

C++ Basic Code "find the random number" 008

#include
void main()
{int num;int input;
randomize();
for(;;){
num= random(100)+1; print ("\what is the number that I created.\n"); do{ printf("please enter the number(end with 999):"); scanf("%d",&input); if(input =999){ exit(0); }
if(input ==num){ printf("this is correct,\n"); } else if(input>num){ printf("this is smaller than what you input.\n"; }ele{ printf("please enter the number that greater than.\n"); } } while(input!=num); }}

1 comment:

  1. #include

    void main()

    {
    int num;
    int input;

    randomize();

    for(;;){

    num= random(100)+1;
    print ("\what is the number that I created.\n");

    do{
    printf("please enter the number(end with 999):");
    scanf("%d",&input);
    if(input =999){
    exit(0);
    }

    if(input ==num){
    printf("this is correct,\n");

    }
    else if(input>num){
    printf("this is smaller than what you input.\n";
    }ele{
    printf("please enter the number that greater than.\n");
    }
    }
    while(input!=num);
    }
    }

    ReplyDelete