My rand() function does not work I have fiddled about and it does not seem to want to work I an trying to make a guessing number program. If you could help me that would be great.
#include <iostream>
#include <string>
#include <cstdlib>
usingnamespace std;
int number(rand() % 11), Restart, inputnumber;
int main()
{
while(inputnumber != number)
{
cout << "\nIm thinking of a number between 1 and 10 guess it:";
cin >> inputnumber;
if(number == inputnumber)
{
cout << "\nYay you are psychic or you went through it logically\n";
}
else
{
cout << "\nWRONG\n ";
}
}
return 0;
}