--:--









Quiz for Scope and lifetime of variables static

Course: C Language | Subject: Unit 4 | Topic: Functions in C



Logo

Q1: Which keyword is used to declare a static variable in C?

Logo

Q2: What is the default initial value of an uninitialized static variable in C?

Logo

Q3: Where is the memory for static variables allocated?

Logo

Q4: What is the lifetime of a static variable in C?

Logo

Q5: Can a static local variable be accessed outside its function?

Logo

Q6: What happens to the value of a static variable between function calls?

Logo

Q7: What is the default storage class of global variables in C?

Logo

Q8: When a global variable is declared as static, its scope is limited to?

Logo

Q9: What is the difference between static and global variables?

Logo

Q10: Which of the following variables is initialized only once in C?

Logo

Q11: Can we initialize a static variable inside a loop?

Logo

Q12: What is the storage duration of a static variable?

Logo

Q13: Which keyword should be used for a variable that should retain its value between function calls?

Logo

Q14: When is a static variable destroyed?

Logo

Q15: Can a static variable be declared inside a structure in C?

Logo

Q16: What is the initial value of a static array if partially initialized?

Logo

Q17: How many times is the initialization of a static variable executed?

Logo

Q18: What is the effect of declaring a static variable inside a function?

Logo

Q19: Can a static variable be modified after initialization?

Logo

Q20: Where is a static local variable stored in memory?

Are you ready to start test? Set your time limit