Posted by: 6ixMediaSA
Comments: 0
Post Date: February 14, 2026
#include <iostream>
#include <ctime>
int main() {
srand(time(0));
int secret = rand() % 10 + 1, g = 0;
while (g != secret) {
std::cout << "Guess 1-10: ";
std::cin >> g;
if (g < secret) std::cout << "Higher!\n";
else if (g > secret) std::cout << "Lower!\n";
}
std::cout << "Correct!";
return 0;
}


Leave a Reply