codegurukool.com · Free coding tutorials & online compiler

Home › C++ Tutorial › C++ output

C++ output

Print with cout.

cout with << prints values. endl or "\n" starts a new line.

Example code

#include <iostream>
using namespace std;
int main() {
  cout << "Age: " << 20 << endl;
  cout << "One\nTwo\n";
  return 0;
}

Run this code in the online editor

← C++ syntax and commentsC++ variables →