Q. Write a program to calculate the distance of 1056 feet in term of yards and mile.
Given fixed values are 1 mile = 1760yards and 1 yard = 3 feet
Answer =
a = 1056 #given print ("In yards = ", a/3, "\nIn miles = ", a / 3 * 1760)
Output :-
In yards = 352.0
In miles = 619520.0
>>>
there is correction in line (a / 3 * 1760)
ReplyDeleteyou need to add brackets in (3 * 1760)
otherwise it will divide first instead of multiplying
We want Divide first and then multiply.
DeleteYour correct
Deletewe multiply first and then we divide.
ReplyDelete1056 Feet = 352 Yards
1056 Feet = 0.2 Miles
No matter which is first.
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )