write a programme in java to convert the weight in gram to kg and g . where weight is 1250 gram
Answers
Answered by
1
Answer:
Following program shows you how to convert grams to kilograms.
In this program we get grams from user, once we get those we need to divide with 1000 so that we get in kilograms
import java.util.Scanner;
public class MathUnitConversions8 {
public static void main(String[] args) {
double grams;
Scanner in = new Scanner(System.in);
System.out.println("Please enter grams:");
grams = in.nextDouble();
double kilograms = grams / 1000;
System.out.println(kilograms + " Kilograms");
Mark my answer as brainliest answer..
Answered by
0
Explanation:
1000g = 1kg
1250g = 1250g
1000g
1.250 kg
1kg 250g
Similar questions
History,
1 month ago
Chemistry,
1 month ago
Math,
10 months ago
Environmental Sciences,
10 months ago