198k views
2 votes
Which of the following are valid values for the integer data type? (Select all that apply)

"integer"
90.1
'1'
true
-25
0
423190
0.1

User Demarchisd
by
4.5k points

1 Answer

4 votes

You can only assign an integer number (i.e. a number without decimal part) to an integer data type.

"integer" is a string, so it's not a number (and thus not an integer)

90.1 has a decimal part, so it's not an integer

'1' is a string, so it's not a number (and thus not an integer)

true is a boolean, so it's not a number (and thus not an integer)

-25

0

423190

0.1 has a decimal part, so it's not an integer

User Saalon
by
4.8k points