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

1. In C++ Boolean value are represented only with the int values 0 for false and 1 for
true.
2. Extensive use of global variables is a satisfactory replacement for the difficulties of
parameter passing with functions.
3. A variable declared outside any function is said to be a local variable.
4. A variable declared within a function block is said to be local to the function.

1. False.
In C++ the bool type is a real type, with values true and false, but
0 is interpreted as true and 0 as false, and true and false will be converted to
1 and 0 respectively.
2. False.
Global variable use ties functions together so tightly that it is impossible
to understand any one function’s behavior apart from the whole of the program. This
complexity makes understanding a program very difficult.
3. False.
This is a global variable.
4. True
Such a variable is said to be local to the function or to have the function
as its scope, and is also known as a local variable if the scope is clear from the
context.

Computer Science & Information Technology

You might also like to view...

________ is a font effect typically used in titles, where the lowercase letters are capital letters but are the same height as lowercase letters

Fill in the blank(s) with correct word

Computer Science & Information Technology

The fastest data transfer port is an HDMI port

Indicate whether the statement is true or false

Computer Science & Information Technology