C Program to Convert Kilograms to Pounds

In this post, we will learn how to convert kilogram to pounds using C Programming language.

This program asks the user to enter the weight in kilograms, then it converts it into pounds using the conversion factor:

  • 1 Kilogram = 2.20462 Pounds

So, without further ado, let’s begin this tutorial.

C Program to Convert Kilograms to Pounds

// C Program to Convert Kilograms to Pounds
#include <stdio.h>
int main(){
    float kg, lbs;
    
    // Asking for input
    printf("Enter the mass in Kilograms: ");
    scanf("%f", &kg);
    
    // Kilogram to Pounds Conversion
    lbs = kg * 2.20462;
    
    // Displaying output
    printf("%.2f Kilograms = %.2f Pounds", kg, lbs);
    return 0;
}

Output

Enter the mass in Kilograms: 2
2.00 Kilograms = 4.41 Pounds

How Does This Program Work ?

    float kg, lbs;

In this program, we have declared two float data type variables named kg and lbs.

    // Asking for input
    printf("Enter the mass in Kilograms: ");
    scanf("%f", &kg);

Then, the user is asked to enter the mass in kilograms. This value gets stored in the kg named variable.

    // Kilogram to Pounds Conversion
    lbs = kg * 2.20462;

We convert kilograms into pounds using the data, 1 Kilograms = 2.20462 Pounds.

    // Displaying output
    printf("%.2f Kilograms = %.2f Pounds", kg, lbs);

Finally, the weight in pounds is printed on the screen using printf() function.

Conclusion

I hope after going through this post, you understand how to convert kilograms to pounds using C Programming language.

If you have any doubt regarding the program, feel free to contact us in the comment section. We will be delighted to assist you.

Also Read:

Leave a Comment

Your email address will not be published. Required fields are marked *