C++ Program : Display Message on Screen using C++

Standard Way to Write C++ Program :

  • Cout is Used to Print Message on the Screen.
  • Insertion Operator is Used to put data on screen (<<)
  • Return type of main function is integer as it returns 0 to operating system upon successful execution of program.
#include <iostream>
using namespace std; 
int main()
{
  cout << "www.c4learn.com"; 
  return 0;
}

.h Style Program : Old Style

#include<iostream.h>
int main()
{
  cout << "www.c4learn.com"; 
  return 0;
}

Output :

www.c4learn.com