Introduction to C Programming Language

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

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 (D)</p>
Signup and view all the answers

Which keyword is used to define a static variable?

<p>Static (C)</p>
Signup and view all the answers

What initialization is allowed for an external variable?

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

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

<p>Static (B)</p>
Signup and view all the answers

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

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

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

<p>'Register' (B)</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. (A)</p>
Signup and view all the answers

Which storage specifier can store the address of a variable?

<p>Register (B)</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 (B)</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 (D)</p>
Signup and view all the answers

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

<p>Register (B)</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. (B)</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 (B)</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 (D)</p>
Signup and view all the answers

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

<p>Register (A)</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. (D)</p>
Signup and view all the answers

Flashcards are hidden until you start studying

More Like This

Java Programming Language History Quiz
5 questions
PHP Programming Language History
5 questions
History of Java Programming Language
13 questions
Use Quizgecko on...
Browser
Browser