C# Program to Convert Meters To Kilometers

In this C# program, we will take the input meters from the user and change it Kilometers.

C# Program to Convert Meters To Kilometers Code:

 private static void Main(string[] args)
        {
            decimal Meter, Kilometer;
            Console.Write("Enter the distance (in meters): ");
            Meter= decimal.Parse(Console.ReadLine());
            Kilometer = Math.Round(Meter / 1000,2);
            Console.WriteLine("{0} meters = {1} Kilometers.", Meter,Kilometer);
            Console.ReadLine();
        }

C# Program to Convert Meters To Kilometers Output:

CSharp-program-to-Convert-Meters-To-Kilometers

 
About Us | Terms of Use | Privacy Policy | Disclaimer | Contact Us Copyright © 2012-2024 CodingFusion
50+ C# Programs for beginners to practice