adsense


Wednesday, 18 November 2015

C++ LANGUAGE SEMICOLONS AND BLOCKS PAGE 05

COMPUTER LANGUAGES HTML,C,C++.JAVA,.NET AND MULTIMEDIA basics and programs click home button



C++ LANGUAGE SEMICOLONS AND BLOCKS





Semicolons & Blocks in C++ 


In C++, the semicolon is a statement terminator. That is, each 
individual statement must be ended with a semicolon. It indicates 
the end of one logical entity. 

For example, following are three different statements: 
x = y; 
y = y+1; 
add(x, y); 

A block is a set of logically connected statements that are 
surrounded by opening and closing braces. For example: 

{ 
   cout << "Hello World"; // prints Hello World 
   return 0; 
} 

C++ does not recognize the end of the line as a terminator. 
For this reason, it does not matter where you put a statement 
in a line. For example: 
x = y; 
y = y+1; 
add(x, y); 
is the same as 
x = y; y = y+1; add(x, y); 


No comments: