4. Basic Program
1. Preprocessor:
# is used to start a program is called preprocessor directory. Directory is an
instructions given to compiler before completing of actual program
preprocessor directory are handled by a program.
2. Include preprocessor:
It is used to include standard header files in the program. It is also a
preprocessor directive.
# include <iostream>
In which iostream is a header file.
Iostream= input-output stream.
5. 3. Header files:
It is a collection of standard library functions perform different tasks. Header files also
known as include files, source files, copy books. This files contain different types of pre-
defined functions.
e.g. iostream, stdio, conio, list, set, limits, etc.
There are 49 header files in the standard c++ library.
4. Main Function:
When the program runs, the control entire main( ) function and starts
executing its statement. All c++ program are divided into units called
functions. Any number of statements can be written in the body of the main
function.
Main function( )
{
body of the statements;
}
6. 5. Statements:
The program is written in curly braces called delimiters. The statement is collecting
known as body of the program.
{ called open delimiter.
} called closed delimiter.
E.g.
{
cout<<“Hello World”<<endl;
return 0;
}
6. Output Command:
The term standard output refers to the output display on monitor. C++ uses the cout
stream object to display standard output. The things written in the quotation marks is
called character string.
E.g.
cout<<“Hello World”<<endl;
7. The operator << is called insertion.
The operator >> is called stream extraction.
Endl or semicolon (;) are called terminator. It is used go to next / new line.
Termination sign shows that the instruction is completed.
In turbo c programming app in which we use Clrscr ( ); it is used to clear
the output screen.
Return is not a necessary thing in main function. Its only used if you start
your body with int main(). Then you have to write return 0; at the end. If
you use void main(), then you do not have to call return.