Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Write a program, which converts miles to kilometers. Format the output to the 2nd decimal place.
- Note: 1 mile == 1.60934 kilometers
- using System;
- namespace _03._Miles_to_Kilometers
- {
- class MilesToKm
- {
- static void Main(string[] args)
- {
- double miles = double.Parse(Console.ReadLine());
- double km = 1.60934 * miles;
- Console.WriteLine($"{km:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment