C++ – Basic Statement

To start work on C++ you need:
– One ‘text editor’ for programmers as Visual Studio on windows or Code::Blocks on Unbuntu
– A compiler to build the executable program

The Basic statement:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// This is a single line comment in C++
 
/*
This is a multiline comment in C++
*/
 
/*  Prepocessor
It will be interpreted before the compilation of the program itself begins
Inclusion of iostream allow to perform standard input and output operations
*/
#include <iostream>
 
// Introduce visibility of 'cout' components,
// without this declaration 'cout' does not work
using namespace std;
 
//  It is the first function called when the program is run
int main()
{
    // character output - text - endline
    cout << "Hello world!" << endl;
    cout << "It is beautiful day!" << endl;
 
    // terminate the program
    return 0;
}