mastery10(The credit of the background image goes to https://flic.kr/p/ay2hhk)

Welcome to Mastery #8!!

It’s all about basic output and input in C++.

It is easy as it sounds.

For output, you have to follow the next structure:

Case #1:  cout << “Here is where you write what you want to ouput” << endl;

Case #2: cout << a << endl;

As you can see, the first case is when you want to show a string value, so you use “” and write something inside them. As for the second case, it is for when you declare a variable and you want the compiler to show it.

It’s very important you follow the structure because if you don’t, you won’t be able to run your code!!

On the other hand, for input, you do the following:

Cin >> n;

The n here represents the variable you are asking to input.

You can see an example of output and input in the next video I made:

 

CC BY 4.0 MASTERY 08: Basic Output (printing) and Input (text based) in C++ by Ana Gloria Angulo is licensed under a Creative Commons Attribution 4.0 International License.