229k views
5 votes
A decimal number contains a decimal point but an integer does not. Create a program that asks a user to type in a number. If the number contains a decimal point, the program should output “Your number is a decimal number”. Otherwise, it should output “Your number is an integer”

User Mjroodt
by
7.6k points

1 Answer

3 votes

You would only need 5 bits because you are counting to 26 (if we take only upper or lowercase letters). 5 bits will count up to 31, so you've actually got more space than you need

User Redconservatory
by
8.0k points

No related questions found