int r;
int n=-1;
srand(time(NULL));
r = (rand() % 10) + 1;
while (n != r)
{
cout << "Enter number between (1-10) : ";
cin >> n;
if (n>r)
{
cout << "Greater than r" << endl;
}
if (n<r)
{
cout << "Less than r" << endl;
}
}
cout << "n equal r" << endl;
cout << n << " = " << r << endl;
ไม่มีความคิดเห็น:
แสดงความคิดเห็น