0

For class, I had to write a simple program that would calculate the surface area and volume of a torus. I did that, but my answers are long decimal numbers. How do I get the answer to round off?

Thanks in Advance

4
Contributors
3
Replies
41
Views
2 Years
Discussion Span
Last Post by isla.rose.3
1

Use integer division. When you are dividing to get the surface area, use "//" instead of just "/". This will round your number. To get remainders, use "%"

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.