Here is a small program. Which of the statements about the variables is correct?

```
#include
const double NUM = 2.9345358;
double num = 3;
double numTimes(int x);
int main( )
{
using namespace std;
int value;
cout << “Enter a value, I’ll multiply it by “
<< NUM << endl;
cin >> value;
cout << “You entered “ << value
<< “ NUM times this is “ << numTimes(value)
<< endl;
return 0;
}
double numTimes(int x)
{
double d;
d = NUM * x;
return d;
}
```

a) NUM is a global variable.
b) num is a global constant.
c) value is local variable in the main function
d) d is a local variable in the numTimes function.

c) value is local variable in the main function, and d) d is a local variable in the numTimes function.

a) and b) are reversed: NUM is a global constant, and num is a global variable.

Computer Science & Information Technology

You might also like to view...

A(n) ________ effect is used to make text or graphics move or change while displayed off the screen

Fill in the blank(s) with correct word

Computer Science & Information Technology

What is the default value for the GridBagConstraint fill?

a. NONE. b. BOTH. c. CENTER. d. HORIZONTAL.

Computer Science & Information Technology