Congratulations - you have completed C Programming : Multiple Choice Questions. You scored %%SCORE%% out of %%TOTAL%%. Your performance has been rated as %%RATING%%
Your answers are highlighted below.
Question 1
Local Variable is having _______ scope ?
A
local
B
inter program
C
only inside current Program
D
global
Question 2
Consider the following fig.

Var1 will be accessible in following block ?
A
Outer Block Only
B
Inner Block Only
C
In Complete Program
D
Inner Block and Outer block
Question 3
Local Variable is Accessible in - [Select Appropriate Option(s)]
A
From function
B
From Main
C
From block in which it is declared
D
None of these
Question 4
Higher priority is given to ________ variable than _______ variable.
A
Local , Global
B
Global , Local
Question 5
Inner Block can access variables declared ___________.
A
inside Outer Block
B
None of these
C
inside Same Block
D
inside Inner Block
Question 5 Explanation: 
Inner Block can access variables declared inside Outer Block.
Question 6
What will be the output of the following program ?
#include<stdio.h>
void main()
{
int var1=10;
  {
  int var2 = 20;
  printf("%d %d",var1,var2);
  }
printf("%d %d",var1,var2);
}
A
Compile Time Error
B
10 20 10 20
C
Run Time Error
D
10 20 10 garbage
Question 6 Explanation: 
Outer block can’t access variables declared inside Inner Block.
Question 7
Guess output of program -
#include<stdio.h>
void main()
{
int var1=10;
  {
  int var1 = 20;
  printf("%d %d",var1,var1);
  }
printf("%d %d",var1,var1);
}
A
20 10 20 10
B
10 10 20 20
C
10 20 10 20
D
20 20 10 10
Question 7 Explanation: 
If same variable is declared inside inner as well as outer block then higher priority will be given to inner block.
Question 8
Can we declare same variable inside the inner and outer block ?
A
Yes, It is possible
B
No , It will give compile error
C
Duplicate Variable is not allowed in C Program
D
None of these
Question 9
In order to create a local variable we need to use local keyword.
 local int var;
A
True
B
False
Question 10
Local variables only exist inside the specific function that creates them. They are unknown to other functions and to the main program
A
False
B
True
Question 11
Local Variables are generally implemented using _________.
A
None of these
B
Stack
C
Queue
D
Linked List
Question 12
Local Variables are recreated each time when function is executed or called !
A
True
B
False
Once you are finished, click the button below. Any items you have not completed will be marked incorrect. Get Results
There are 12 questions to complete.