-
Comment on the following 2 C Example programs.
#include <stdio.h> //Example 1
int main()
{
int p;
int q;
int r;
}
#include <stdio.h> //Example 2
int main()
{
int p;
{
int q;
}
{
int r;
}
}
-
- Scope of r is till the end of the main function in Example 2
- In Example 1, variables p, q and r can be used anywhere in main function whereas in Example 2, variables q and r can be used only inside their respective blocks.
- Both are same
- Scope of p, q and r is till the end of the main function in Example 2.
- None of these
Correct Option: B
None of these