Computer Applications

Write a program to convert kilograms to pounds in the following tabular format (1 kilogram is 2.2 pounds):

KilogramsPounds
12.2
24.4
2044.0

Java

Java Iterative Stmts

4 Likes

Answer

public class KboatKiloToPound
{
    public static void main(String args[]) {
        System.out.println("Kilograms \t Pounds");
        for(int i = 1; i <= 20; i++) {
            double p = i * 2.2;
            System.out.println(i + "\t\t" + p);
        }
    }
}

Output

Answered By

3 Likes


Related Questions