This is a discussion on What is the difference between a statement and a block? within the C and C++ Programming forums, part of the Software Development category; Hi, Any one Explain. Thanks, Sundar Raja...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| 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 |
| |||
| Hi, we can say more than one statement(except declaration) is a block, because it is compulsory that the statement should be described in block only. default as main function block. Regards, Vivekanandan. |
| |||
| An instruction or a set of instruction is called Statement, A group of Statements grouped within a set of brace( {} ) is called Block or block of statements
__________________ SeeSamJagan- Sky is not the "LIMIT", Death is not the END, There is still something beyond.... |
| |||
| one more tip about block within a block, again we can declare variables which will be local to that block and its scope is limited to that block
__________________ SeeSamJagan- Sky is not the "LIMIT", Death is not the END, There is still something beyond.... |
![]() |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/c-c-programming/2397-what-difference-between-statement-block.html | |||
| Posted By | For | Type | Date |
| DiscussWeb IT Community - Fusing | This thread | Refback | 08-11-2007 12:36 AM |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Difference between echo and print statement? | devarajan.v | PHP Programming | 2 | 07-30-2007 04:26 AM |
| What is TRY/CATCH block in T-SQL? | oxygen | Database Support | 1 | 07-26-2007 04:19 AM |
| Is it necessary that each try block must be followed by a catch block? | mobilegeek | Java Programming | 1 | 07-24-2007 06:44 AM |
| block the source code | Alan | HTML, CSS and Javascript Coding Techniques | 5 | 04-23-2007 02:21 AM |
| difference between structured and block structured language | nssukumar | C and C++ Programming | 0 | 03-03-2007 01:42 AM |