Please note that some of this code does not work properly.
//random.cpp //this program is a random number guessing game //written by billy gesner //written for c++ //due by now #include < iostream.h > //declares librarys #include < conio.h > #include < iomanip.h > #include < stdlib.h > #include < windows.h > void check(int,int); //initializes void function int randomnumber(); //initializes value returning function int main() //starts main program { int num,guess,amount=0; char again='y'; while(again=='y') //user choses to run agian { num=randomnumber(); //calls for random number while(guess!=num) //runs checking loop { cout<<"please guess a ";//tells user to enter number cout<<"number between "; cout<<"0 and 500!"; cin>>guess; //takes in guess while((guess<0)||(guess>500))//checks if entry is valid { cout<<"that is not"; cout<<" a valid"; cout<<" entry"; cout<
>guess; } amount=amount+1; check(guess,num); //calls for check function } cout<<"It took you "; cout<
>again; } return 0; } int randomnumber() //the random number function { return(rand()%500); //retruns a value from 0 to 500 } void check(int guess2,int num2) //takes guess and num and puts them { //into new variables if(guess2!=num2) //checks if the guess is right { if(guess2>num2) //checks if guess is to big { cout<<"lower"<