-->

c++ to print hello world

//program to print hello world    //comment line
#include <iostream>              // header file to handle input and output
#include<stdlib.h>               // header file to handle system(cls).
using namespace std;             //to handle all standard characters/functions,reserved words  used in program. we do not use in turboc++ compiler
int main()                       // main function as starting point of execution
{
    cout<<"firstline"<<endl;
    system("cls");                 //clears the screen
    cout << "Hello world!" << endl;// cout is an object and is pre-defined. It is responsible for output     // stream. endl is to end the line.
                                   //<< is called insertion operator or put -to operator.
    return 0;                       // the string inside double quote is string constant. Here it is "hello world".
}

No comments:

Post a Comment