KnowledgeBoat Logo

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

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

Answered By

1 Like


Related Questions