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):
| Kilograms | Pounds |
|---|---|
| 1 | 2.2 |
| 2 | 4.4 |
| 20 | 44.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
