#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctime>
srand();
int main ()
{
int guess;
guess=1+rand()%100;
cout << "Guess what number I am thinking of... : ";
cout << guess;
cin >> guess;
while (guess != rand())
{
while (guess < rand())
{
cout << "The number is higher...Guess again : ";
cin >> guess;
}
while (guess > rand())
{
cout << "The number is lower...Guess again : ";
cin >> guess;
}
while (guess == rand())
{
cout << "You are correct";
break;
}
}
return 0;
}
im trying to make a guessing game that the program generates a random number between 1 and 100 is there a way to do that?