Note: Please use scantron for your work 1. Where is a global variable defined A.
ID: 3812208 • Letter: N
Question
Note: Please use scantron for your work 1. Where is a global variable defined A. Outside a function B. Inside a function C. Anywhere D. In a function header line 2. Where can a local vanable be defined? A. Outside a function B. Inside a function C. In a function header line D. Both B and C 3. Given this code: int z int main int y 3, x 2: return 0 What is the scope ofvariable z? A local B. static C. global D. none of the above 4. The list of input datatypes and variable names found in the function header line is referred to as the function's A format B. arguments C. retum types D. objects. 5. Which function name below is invalid? A, setName B. Calculate Average C., 4 N ames D. both B and C 6. If a variable is declared as static inside a function, what parts of the program can see the variable? A. Any function called after the static variable was declared. B. Only the function in which it was declared. C. The entire program. D. Other functions declared as static, 7. At what point is a static variable released from memo A. When the program te es. B. After the retum statement is executed. C. When the function teminates. D. When the value changes S. When is a retum statement required inside a function? A. Every function must include at least one retum statement B. When you use a switch statement. C. When a retum datatype (other than vol is included in the function prototype. D. Inside an if-else statement. 9. What is wrong with this call statement PrintName (string name) A. It's missing "void B. The datatype should beremoved. C. The semicolon should be removed. D. Nothing is wrong with it. 10. In this prototype, what is missing? voidPrintNumber (int) A Nothing is missing, it is complete. B. The vanable name must be included in the input list. C. A semi-colon D.Aretum type.Explanation / Answer
Hi, I have answered first 10.
Please repost others in separate post.
1.
Ans: A. Outside a function
2.
Ans: D. Both B and C
3. Ans: C. global
4. Ans: B. arguments
5. Ans: C. 4_Names
6. Ans: B. Only the function in which it was declared
7. Ans: A.When the program terminates
8. Ans: C
9. B
10. C
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.