# C++ User Input and output

In C++, input and output are typically handled by using the standard input and output streams, which can be represented by the objects cin and cout. cin is used for the input and cout is used for the output.

1. We use `cout` to output text to the console.
    
2. We use `cin` to read input from the user. Note that `>>` is used to extract values from the input stream.
    

You'll see that it asks the user for an integer, reads the input, and then displays it back to the user.

Let us explain the input and the output with a simple example.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695876892224/408d4f21-56e1-424c-af5b-be91703bbc30.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695876968717/491a2cda-2f6f-4644-859a-fbf2fa883ff8.png align="center")

Thanks for reading,

Mohammed Muqafamuddin.
