--:--









Quiz for Scope and lifetime of variables register

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



Logo

Q1: What is the main purpose of declaring a variable as register in C?

Logo

Q2: Where are register variables generally stored?

Logo

Q3: What is the default initial value of a register variable in C?

Logo

Q4: Which of the following is NOT true about register variables?

Logo

Q5: What will happen if CPU registers are not available for a register variable?

Logo

Q6: Can you get the address of a register variable using & operator?

Logo

Q7: What is the scope of a register variable declared inside a function?

Logo

Q8: What is the lifetime of a register variable?

Logo

Q9: Which keyword is used to declare a register variable?

Logo

Q10: What is the maximum number of register variables allowed?

Logo

Q11: Why can’t we apply sizeof operator to register variables?

Logo

Q12: Can register variables be used for storing large arrays?

Logo

Q13: Which type of variables are best suited for register storage?

Logo

Q14: If we declare register int x;, what will compiler do if no register is available?

Logo

Q15: Can register variables be declared as static?

Logo

Q16: Are register variables stored in stack or heap if not in registers?

Logo

Q17: Which statement is correct for register variables?

Logo

Q18: Can register be used for pointer variables?

Logo

Q19: Which of the following is a disadvantage of register variables?

Logo

Q20: What happens if we try to print address of a register variable?

Are you ready to start test? Set your time limit