49.9k views
1 vote
If variable answer stores a Boolean value, then what are the possible values for the variable?

0 or 1

"true" or "false"

true or false

any value

User PetrosB
by
4.7k points

1 Answer

4 votes

Answer:

true or false and 0 or 1.

Step-by-step explanation:

The boolean variable can have only two values that can be true or false.

Since we have variable answer of type boolean it can store true or false.In boolean algebra 0 is considered as false and 1 is considered as true.So we can also store 0 or 1 in boolean.If we store any other value in boolean algebra it will be regarded as 1 because only 0 is considered as false everything else is true.

User Sudhir
by
4.9k points