There are four types of loop. They are while, do while, nested, for loop.
for loop with a semicolon is called as body less for loop. It is used only for incrementing the
variable values. So in this program the value is incremented and printed as 10.
$ g++ stat2.cpp
There is not a condition in the for loop, So it will loop continuously.
Because the break statement need to be presented inside a loop or a switch statement.
The switch statement is used to choose the certain code to execute, So it is also called as
Inthis program, We are printing the numbers in reverse order but by using break statement we
stopped printing on 3.
$ g++ stat.cpp
In the conditional operator,it will predicate the output using the given condition.
There are five sequence of statements. They are Preprocessor directives,Comments,Declarations,
Function Declarations,Executable statements.