Skip to main content

C++ User Input and output

Published 1 min readMarkdown

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.

Thanks for reading,

Mohammed Muqafamuddin.

No comments yet. Be the first to comment.

More from this blog