Computer Applications
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 |
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): BlueJ output of Write a program to convert kilograms to pounds in the following tabular format (1 kilogram is 2.2 pounds):](https://cdn1.knowledgeboat.com/img/lgx10/c9-itr-constructs-p14.jpg)
Answered By
1 Like
Related Questions
Write a program using do-while loop to compute the sum of the first 500 positive odd integers.
Write a program in Java to read a number and display its digits in the reverse order. For example, if the input number is 2468, then the output should be 8642.
Output:
Enter a number: 2468
Original number: 2468
Reverse number: 8642Write a program that displays all the numbers from 150 to 250 that are divisible by 5 or 6, but not both.
Write three different programs using for, while, and do-while loops to find the product of series 3, 9, 12,… 30.