#include "stdafx.h" #include <iostream> #include "string" #include <cstdlib> #include <ctime> using namespace std; int main() { cout << "Make the number from 1 to 6" << endl; srand(static_cast<unsigned int>(time(0))); int number = rand() % 6+1; string answer; do { cout << "Is your number " << number << "?" << endl; cin >> answer; if (answer == "yes") { cout << "Your number is " << number << endl; } } while (answer!="yes"); return 0; } Tell me please. There is a code above. In theory, each cycle he should ask the user whether he made the correct number (the user keeps the number in his head). The number is from 1 to 6 and it should be different for each cycle. When the program guesses, displays the instruction from the if. But I constantly get the number 6 instead of different numbers. Where did I go wrong?