Skip to main content

Simple hello world program and explanation

HELLO WORLD PROGRAM AND EXPLANATION
• Hello world program

# include<iostream.h> 
#include<conio.h>
// pre-processor directives ,header files 
        Void main ()
// main () is where program execution start
          {
                Clrscr ();
//its clear output of the previous  program.
              Cout<<”HELLO WORLD”;
       // prints hello world .
              Getch();
       //its hold the output screen of the program.
                      }

                       OutPut
                HELLO WORLD

Explanation
Above program is the simple c++ program  which prints “HELLO WORLD”.
• Header files
Header file is the definition of all input and output function  like cin>> ,cout<<; ,getch();
1. #include<iostream.h>
Iostream stand for input output stream .cin>> cout<< whenever these functions are invoked program there definition taken from this  file by complier
2. #include<conio.h>
Conio stand for Console  input output .Commanly used function of conio.h Clrscr(); getch();
• Void main ()
Void main(); is the starting point  of the program when program complied the compiler search for main () then after remained program is compiled.
• Clrscr();
Its working is written in conio.h header file .This function clear output screen of previous program.
• Cout<<
Its definition in iostream.h header file .its used for print the written text  in double quotes  “HELLO WORLD “
Cout<<” HELLO WORLD “;
• Cin>>
Its definition in iostream.h and it accepts the input given by the user
 For eg.
            Void main ()
              {
                       Int a;
                         Cin>>a;
               }
• Getch();
Getch(); is used to hold the output screen until you don’t press any key.
• Comments
Comments are the text written by the programmer for programmer  to understand cod
Comments are tow type

Single-line comment 
// This is example of single line comment.


Multiple line comment
/*
This is  example of multiple line comment
*/

Comments

Popular posts from this blog

Introduction of c++

C++            Is powerful ,complied ,genenral-purpose ,case-sensitive programming language that supports procedural,object-oriented programming,                 Features of c++  Object-oriented programming language.  Simple. Case sensitive.  Platform dependent. Syntax based language. Powerful. Portability. Compiler based. Efficient use of pointer.

Features of c++

  Features   Object oriented Programming language : This main advantage of C++ is, it is object oriented programming language. It follow concept of oops like polymorphism, inheritance, encapsulation, abstraction. Simple :Every C++ program can be written in simple English language so that it is very easy to understand and developed by programmer. case sensitive programming language: In C++ programming 'break and BREAK' both are different. If any language treats lower case latter separately and upper case latter separately than they can be called as case sensitive programming language Example c, c++, java, .net are sensitive programming languages. other wise it is called as case insensitive programming language Example HTML, SQL is case insensitive programming languages.  Platform dependent : A language is said to be platform dependent whenever the prog...