ICSE Class 10 Computer Applications Question 18 of 69

Iterative Constructs in Java — Question 18

Back to all questions
18
Question

Question 14

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
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 KboatKiloToPound.java
Answer