Answers for "Convert g to kg"

0

Convert g to kg

using System;

class MainClass {
  public static void Main (string[] args) {
    Console.WriteLine ("Please enter grams:");
    double grams = Convert.ToDouble(Console.ReadLine());
    double kilograms = grams / 1000;
    Console.WriteLine(kilograms + " Kilograms");
  }
}
Posted by: Guest on August-14-2021

Browse Popular Code Answers by Language