--:--









Quiz for Scope and lifetime of variables auto

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



Logo

Q1: Which keyword is used to declare an automatic variable in C?

Logo

Q2: What is the default storage class for local variables in C?

Logo

Q3: Where are automatic variables stored?

Logo

Q4: When is an automatic variable created?

Logo

Q5: What is the lifetime of an automatic variable?

Logo

Q6: Automatic variables have which type of scope?

Logo

Q7: By default, local variables are initialized to?

Logo

Q8: If no storage class is specified for a local variable, it is?

Logo

Q9: Which is true about automatic variables?

Logo

Q10: What happens to an automatic variable when a function ends?

Logo

Q11: Can an automatic variable be declared outside any function?

Logo

Q12: Are auto variables thread-safe?

Logo

Q13: Can auto keyword be omitted for local variables?

Logo

Q14: Default initialization of an automatic int variable gives?

Logo

Q15: Where is the memory for automatic variables allocated?

Logo

Q16: When are automatic variables destroyed?

Logo

Q17: Which of the following is NOT true for automatic variables?

Logo

Q18: What happens if you declare a variable as auto inside a loop?

Logo

Q19: Can an automatic variable be static at the same time?

Logo

Q20: Automatic variables are created in which phase of program execution?

Are you ready to start test? Set your time limit