C++ Standard Input Question

Question

Write a program that accepts an integer number from the standard input and then print that number.

You can use the following code structure.

#include <iostream> 

int main() 
{ 
    //your code here
} 


#include <iostream> 

int main() 
{ 
    std::cout << "Please enter a number: "; 
    int x; 
    std::cin >> x; 
    std::cout << "You entered: " << x; 
} 



PreviousNext

Related