c++ read console input
#include <iostream>
int main() {
// Declare a variable to store user input
int userInput;
// Prompt the user to enter a value
std::cout << "Enter a number: ";
// Read the user input from the console and store it in the variable
std::cin >> userInput;
// Display the input value
std::cout << "You entered: " << userInput << std::endl;
// Return 0 to indicate successful execution
return 0;
}