SEED Infotech Ltd. Official Curriculum Basic ‘C’ Programming: Variables Linkage Quiz
12 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

What is the characteristic of static variables declared in function scope?

  • Are global variables
  • Have external linkage
  • Have no linkage (correct)
  • Are initialized to zero by default

How are external variables defined and accessed in a C program?

  • They have no linkage and are local to a specific function
  • Are stored in the stack memory for better access
  • Declared outside any function and are accessible globally (correct)
  • They are declared as 'static' within functions

Which section of memory stores static variables in C programs?

  • Stack memory
  • Code section
  • Heap memory
  • Data section (correct)

What is the default initial value for external variables in C?

<p>Initialized to zero (D)</p> Signup and view all the answers

What is the scope of extern variables in a C program?

<p>Global, accessible from any function within the program (D)</p> Signup and view all the answers

Which type of linkage do global variables have in C programs?

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

What type of linkage does the global variable 'rateOfInt' have?

<p>External linkage (D)</p> Signup and view all the answers

Where is the global variable 'rateOfInt' stored in memory?

<p>In the data section (C)</p> Signup and view all the answers

What is the initial value of the global variable 'rateOfInt'?

<p>9.75 (A)</p> Signup and view all the answers

When is the value of 'rateOfInt' accessed in the dispBal() function?

<p>Only when dispBal() is first called (A)</p> Signup and view all the answers

Which part of the memory retains the value of 'rateOfInt' between different function calls?

<p>Data section (D)</p> Signup and view all the answers

What type of directive is a preprocessor directive in C programs?

<p>'#'-starting instruction (D)</p> Signup and view all the answers

More Like This

Use Quizgecko on...
Browser
Browser