?In the following code, what is the scope and lifetime of the num1 variable?
?
int num2 = 100;
int main()
{
?
   for (int num1=1; num1 < num2; num1+=1)
   {
       ............. more code here ...........
   }
}

A. ?global, until the for loop ends
B. ?local, until the program ends
C. ?local, until the for loop ends
D. ?global, until the program ends


Answer: C

Computer Science & Information Technology

You might also like to view...

You have a program with a class that is separated into files. The implementation has been changed. Of the interface file, the implementation file and the application file, which must be recompiled?

a. Only the interface? b. Only the implementation? c. Only the Application? d. None of the above? e. Some of the above?

Computer Science & Information Technology

A pointing device, such as a mouse or touchpad, is used to control the pointer

Indicate whether the statement is true or false

Computer Science & Information Technology

The ____________________ is the name of the court that has authority to rule with reference to specific persons or subject matter.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The privilege ____ can be granted to change data.

A. WRITE B. UPDATE C. ALTER D. READ AND WRITE

Computer Science & Information Technology