- 1
How can you write a program that can convert distance in miles to kilometers?
2 Respostas
+ 1
Please do not put links in the tag section – we cannot follow the link.
Rather tag the relevant programming language and put your link in the description
+ 1
1 mile = 1.609 kilometres
Can't make a program asking for miles and converting it into kms??
Okay, lets take another example, kilometres to meters, ok?
1kilometer = 1000meters
So if i input 1.6 then i would multiply it by how much??by 1000meters
So output: 1600 meters
Ok, so we have done kms to ms
Now do the same for to convert a given input (as float or int) to kilometres!
Simple!