STD::Cout Examples

Here’s some examples of how to use cout. This list is not exhaustive, and does not cover all use cases. This is just to give you an idea.


using namespace std;

//This is a function we’ll talk about these in lesson 18 / 19
int returnNumber(){
int number = 5 + 5;
return number;

int main(){
int myNumber = 5; // Declare a whole number variable (integer) and set it equal to 5
cout << "Test" << endl; // Will Output Test, without quotation marks then skip to the next line cout << myNumber << endl; // Will output 5, and then go to the next line cout << "\nInline-line-break" <