C quiz questions with answers - Storage classes MCQs
Questions
1
Regarding the scope of the variables identify the incorrect statement:
Answer: Option [A]
By default Automatic variables are initialized to Garbage value.
2
What will be the output of the following code segment?
void fn()
{
static int i=10;
printf("%d",++i);
}
main()
{
fn();
fn();
}
Answer: Option [C]

⭐ Make GKSeries Your Preferred Source on Google
Add GKSeries as Preferred Source
3
Which of the following is not a proper storage class in 'C'?
Answer: Option [B]
The storage classes in C are auto, extern, static and global. dec is not a storage class.
4
What is the output of the following code?
main()
{
static int num=8;
printf("%d",num=num-2);
if(num!=0)
main();
}
Answer: Option [C]
