print cpp code example

Example 1: how to print in c++

#include <iostream>

int main() {
  std::cout << "Hello, World!"; // prints 'Hello, World!' to the output.
  return 0;
}

Example 2: how to print in c++

#include <iostream>
using namespace std;

int main(){
  cout<<"Hello World!"<< endl; // prints "Hello World"
  return 0;
}

Example 3: print in cpp

#include <iostream>
using namespace std;

int main() {
  cout << "Hello World!";
  return 0;
}

Example 4: how to output text in c++

std::cout << " Something ";

Example 5: PRINT IN C ++

#include <iostream>
std::cout << someString << "\n";

Example 6: how to print in c++

#include <iostream>

int main() {
  std::cout << "Hello World!"; //cout keyword prints "Hello World!"
  return 0;
}

Tags:

Java Example