Sail E0 Webinar
Question
Does this compile without error?
int main()
{
int k;
{
int k;
for (k = 0; k < 10; k++);
}
}
Options:
A .  Yes
B .  No
C .  Depends on the compiler
D .  Depends on the C standard implemented by compilers
Answer: Option A


There can be blocks inside block and within blocks variables have only block scope.
Output:
$ cc pgm5.c



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers