Introduction to C Programming Language
19 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which specifier is used to define a variable that can hold its value between multiple function calls?

  • External
  • Auto
  • Register
  • Static (correct)
  • What is the initial default value of a static integral variable?

  • Memory address
  • 0 (correct)
  • Garbage
  • Null
  • Which storage class allows variables to be allocated memory in the CPU registers?

  • Register (correct)
  • Static
  • External
  • Auto
  • What is the accessibility scope of a static global variable?

    <p>Limited to the file</p> Signup and view all the answers

    Which keyword is used to define a static variable?

    <p>Static</p> Signup and view all the answers

    What initialization is allowed for an external variable?

    <p>Global initialization only</p> Signup and view all the answers

    Which storage specifier cannot be used for the same variable as register?

    <p>Static</p> Signup and view all the answers

    'The initial default value of the register local variables is _.' Fill in the blank.

    <p>'0'</p> Signup and view all the answers

    'We can store pointers into the register.' - This statement refers to which type of variables?

    <p>'Register'</p> Signup and view all the answers

    What is the main difference between static and register variables?

    <p>Static variables can hold their value between multiple function calls, while register variables have faster access time.</p> Signup and view all the answers

    Which storage specifier can store the address of a variable?

    <p>Register</p> Signup and view all the answers

    In C programming, where is the visibility of a static global variable limited to?

    <p>The file in which it is declared</p> Signup and view all the answers

    What is the default initial value of a static integral variable if no value is explicitly assigned?

    <p>0</p> Signup and view all the answers

    Which storage class allows variables to be allocated memory into the CPU registers?

    <p>Register</p> Signup and view all the answers

    What happens if we try to dereference a register variable in C programming?

    <p>It results in a syntax error.</p> Signup and view all the answers

    Which keyword is used to indicate that a variable is declared with external linkage elsewhere in the program?

    <p>#extern</p> Signup and view all the answers

    Which type of variables cannot be stored into the CPU register due to already having a storage specifier?

    <p>Static</p> Signup and view all the answers

    'We can store pointers into the register.' - This statement refers to which type of variables?

    <p>Register</p> Signup and view all the answers

    Which of the following statements about static local variables is TRUE?

    <p>They are visible only to the function or block in which they are defined.</p> Signup and view all the answers

    More Like This

    Use Quizgecko on...
    Browser
    Browser