But I have started to use rand and stuff, so here is my program:
#include <iostream>
#include <fstream>
#include <istream>
#include <cstdlib>
#include <ctime>
using namespace std;
void getComNum();
void ask();
void test();
bool again;
int userNum;
int comNum;
int main (){
void ask();
void getComNum();
void test();
};
void ask(){
cout << "Hello, I am thinking of a number between 1 and 100.."<< endl;
cout << "..what number do you think it is?? " << endl;
};
void test(){
while(again==true)
cin >> userNum;
if(userNum > comNum || userNum < comNum){
cout<<"try again "<<endl;
again=true;
}else{cout<<"You are correct"<<endl;}
}
void getComNum(){
srand(time(0));
comNum = 1+(rand()%100);
};
Tell me any problems or anything you notice I'm missing and tips.
THANK YOU "I'm new"

New Topic/Question
Reply



MultiQuote





|