Share your repls and programming experiences

← Back to all posts
Type Casting Programming Exercise #3
keithfiore

Instructions
Input a double and print the first two digits after the decimal point with a space between them.

Sample run:
Please input a decimal number:
2.8934
Answer: 8 9

Hint - to complete the second coding activity in lesson 5 you had to learn how to get individual digits from an int value. You can reuse this method once you convert the user input to an appropriate int value
(you will need both multiplication and casting for this)

Voters
TyMcgivery
keithfiore