MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

ALGORITHMS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Variables and constants provides storage for program data
A
False
B
True
C
Either A or B
D
None of the above
Explanation: 

Detailed explanation-1: -Notice that variables are used for temporary storage. When you exit a program or turn the computer off, the information in variables is lost. Permanent storage is a different matter. Typically, the values from variables are permanently stored either to a database or to a file on disk.

Detailed explanation-2: -A constant is a named data item with a predefined value, while a variable is a named data item whose value can change during the course of program execution. Variables can be either global or local. All data is represented as one of three basic data types: Int. Integer data type ( +-followed by 1 or more digits 0–9).

Detailed explanation-3: -Understanding Constants A constant is a data item whose value cannot change during the program’s execution. Thus, as its name implies – the value is constant. A variable is a data item whose value can change during the program’s execution. Thus, as its name implies – the value can vary.

Detailed explanation-4: -Many variables store numbers and strings, like the ones above. Variables can also store other types of data, like lists, dictionaries, and Boolean values (true/false).

There is 1 question to complete.