In this example, we will write a program to convert pounds to kilograms in C#. On the web you will show this example as C# lb to kg convertor.
Firstly we should know the ratio of lbs to kg. The following formula shows the lbs ratio of kg.
1 pound (lb) is equal to 0.45359237 kilograms (kg)= 1 lb = 0.45359237 kg
Example
Convert 5 lb to kilograms: m(kg) = 5 lb × 0.45359237 = 2.268 kg
Pounds to Kilograms conversion table
Pounds (lb) | Kilograms (kg) | Pounds (lb) | Kilograms (kg) | |
0 lb | 0 kg | 10 lb | 4.536 kg | |
0.1 lb | 0.045 kg | 20 lb | 9.072 kg | |
1 lb | 0.454 kg | 30 lb | 13.608 kg | |
2 lb | 0.907 kg | 40 lb | 18.144 kg | |
3 lb | 1.361 kg | 50 lb | 22.680 kg | |
4 lb | 1.814 kg | 60 lb | 27.216 kg | |
5 lb | 2.268 kg | 70 lb | 31.751 kg | |
6 lb | 2.722 kg | 80 lb | 36.287 kg | |
7 lb | 3.175 kg | 90 lb | 40.823 kg | |
8 lb | 3.629 kg | 100 lb | 45.359 kg | |
9 lb | 4.082 kg | 1000 lb | 453.592 kg |
Here is the code how to convert Pounds to Kilograms
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
class Program { static void Main(string[] args) { Console.WriteLine("C# lb to kg program\n"); Console.Write("Enter a number in pounds: "); double pounds = Convert.ToDouble(Console.ReadLine()); double kilograms = pounds * 0.45359237; Console.WriteLine(pounds + " pounds is " + kilograms + " killograms"); Console.ReadLine(); } } |
Output:
This is a C# program that converts pounds to kilograms. The program has a class called “Program” that contains a Main method, which is the entry point of the program.
In the Main method, the program starts by printing a message to the console asking the user to enter a number in pounds. The user’s input is then read and converted to a double-precision floating-point number using the “Convert.ToDouble” method.
Next, the program calculates the equivalent weight in kilograms by multiplying the weight in pounds by a constant value of 0.45359237. The result is then displayed on the console using the “WriteLine” method.
Finally, the program waits for the user to press the Enter key by calling the “ReadLine” method, which pauses the program until the user inputs something. This allows the user to see the result before the program exits.
why c#  ??
Thank you! I appreciate your interest. I noticed the error in the section and will make the necessary correction. Thanks for your feedback!