Re: What is the difference between a statement and a block? hi sundarraj, Statement
Statement has three types
assignment
=
selection (branching)
if (expression)
else
switch
iteration (looping)
while (expression)
for (expression;expression;expression)
do {block} Blocks
These statements are grouped into blocks, a block is identified by curly brackets...There are two types of block.
statement blocks
if ( i == j)
{
printf("martin \n");
}
The statement block containing the printf is only executed if the i == j expression evaluates to TRUE.
function blocks
int add( int a, int b) /* Function definition */
{
int c;
c = a + b;
return c;
}
The statements in this block will only be executed if the add function is called.
__________________
J.Vijayanand |