✏️ Explanatory Question
C is a block-structured language. Blocks are delimited by { and}. Every block can have its own local variables. Blocks can be defined wherever a C statement could be used. No semi-colon is required after the closing brace of a block.
Code:
#include<stdio.h>
#define semicolon ;
void main()
{
int a = 5;
printf("\n%d", a);
{
int a = 2;
printf("\n%d", a);
}
}
Output:
5
2Press any key to continue . . .
Reference to a variable will be to the variable of that name in the nearest enclosing block.