Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A) The Entire Program including Other Source Files B) This Source File (and No O

ID: 3742637 • Letter: A

Question

A) The Entire Program including Other Source Files B) This Source File (and No Other Source Files) C) The Function foo20 D) The Function foo10 #include #de fine SIZE 5 long fellow; static int cling420; int fool char grade) (fool) (grade) static int array [SIZE]; int result420; /*Other code here*/ int foo2( int array[l, int size (foo2) (array) (size) int result; static int teaTime 420; /*Other code here/ How many times is the variable result in foo10 initialized to 420 if foo10 is called 5 times? times How many times is the variable teaTime in foo2) initialized to 420 if foo20 is called 5 times? times What is the initial value of variable result in function foo20 when foo20 is called? What is the initial value of variable fellow when this program is run? (continued on other side)

Explanation / Answer

Question1:

Answer: 5 times

result is local variable in foo1() so it will be initialized ech time we call.

Question2:

Answer: 1 time

teaTime is static variable and must be intialized before the execution. So how many ever times we call the function static variable initialized only once before the execution.

Question 3:

Answer: Can't be determined (or) some garbage/random value

The value of "non static local(non-global) variable is indeterminate without initialization.

Question 4:

Answer: 0 (zero)

Global and static variables have '0'(zero) as their default value.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote