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

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

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

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

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

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

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

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

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

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

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

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

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

    More Like This

    Use Quizgecko on...
    Browser
    Browser