Challenge: Find Twice and One Fifth of a Floating Point Value
Here is a coding challenge related to floating point types and arithmetic operations.
We'll cover the following
Problem statement: #
Write a program that should print twice the value of a variable, followed by the one-fifth(1/5) of the same value.
Input #
2.37
Output #
Twice = 4.74 and One Fifth = 0.474
Challenge #
This problem is designed for you to practice, so try to solve it on your own first. If you get stuck, you can always refer to the explanation and solution provided in the next lesson. Good luck!
Get hands-on with 1400+ tech skills courses.