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...

To print a range of pages, you should enter the first page, a colon, then the last page in the range.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

How would you implement the equivalent of a remote procedure call using a tuple space? What are the advantages and disadvantages of implementing a remote procedure call–style interaction in this way?

What will be an ideal response?

Computer Science & Information Technology

Once a chart has been created, you can change its type

Indicate whether the statement is true or false

Computer Science & Information Technology

Most programming languages allow you to ask two or more questions in a single comparison.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology