MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

ALGORITHMS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is a Boolean?
A
A data type that contains whole numbers. eg:3, 45, 124
B
Numbers with decimal point. eg:0.5, 2.45, 56.04
C
Group of characters between quotation marks. eg:“dog”
D
Data type that can only be True or False.
Explanation: 

Detailed explanation-1: -The BOOLEAN data type stores TRUE or FALSE data values as a single byte. The following table shows internal and literal representations of the BOOLEAN data type. You can compare two BOOLEAN values to test for equality or inequality. You can also compare a BOOLEAN value to the Boolean literals ‘ t ‘ and ‘ f ‘.

Detailed explanation-2: -A Boolean variable has only two possible values: true or false. It is common to use Booleans with control statements to determine the flow of a program.

Detailed explanation-3: -Variables of the Boolean data type can only be assigned one of the following values: TRUE, FALSE, or NULL.

Detailed explanation-4: -A boolean data type is declared with the bool keyword and can only take the values true or false . When the value is returned, true = 1 and false = 0 .

There is 1 question to complete.