1.

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;
}
}

A. Scope of r is till the end of the main function in Example 2
B. 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.
C. Both are same
D. Scope of p, q and r is till the end of the main function in Example 2.
E. None of these
Answer» C. Both are same


Discussion

No Comment Found

Related MCQs