Saturday, August 3, 2019

1. first program

This is the most common program that all the programmers run, "Hello World", we say hello to the programming world.

#include <iostream>

int main(int argv, char** argc)
{
  std::cout<<"Hello World!"<<std::endl;
  return 0;
}


Same program can be modified by adding the namespace as follows

#include <iostream>
using namespace std;

int main(int argv, char** argc)
{
  cout<<"Hello World!"<<endl;
  return 0;
}

The term std (standard) need not to be used once the namespace std is introduced to the program.

No comments:

Post a Comment