The basic structure of a C++ Program
#include <iostream.h>
int main()
{
cout<<“My First Program” ;
return 0;
}
#include – is the directive and are processed by the Preprocessor. #include is a directive which tells the compiler to include a header file named iostream.h. The iostream is the file which contains the standard input and output functions.
int main() – is the function where the execution of the program starts. The open braces ‘{‘ indicates the beginning of the main function and the close braces ‘}’ indicates the end of the program.
cout<< is the the output statement which displays the text “My First Program” . The semicolon indicates the end of the statement.
return 0 – returns a value and indicates the end of the function.
This program indicates the basics of C++.
Aeroboticsglobal, the leading robotics academy in Australia provides robotics holiday and after school program with the basic programming languages C++, Java, Python.