Lets write a C program to Convert weight from Pounds to Kilograms.
Note: 1 Pound is approximately equal to 0.453592 Kilogram.
Page Contents
kilogram = pound * 0.453592;
OR
From our previous video tutorial C Program To Convert Kilograms to Pounds
pound = kilogram * 2.20462;
pound / 2.20462 = kilogram;
kilogram = pound / 2.20462;
Related Read:
Keywords, Constants, Variables: C
Basic Arithmetic Operations In C
First we ask the user to enter weight / mass in pounds. Then we multiply that value with 0.453592. The result itself is the Kilograms equivalent of user entered weight in pound.
Video Tutorial: C Program To Convert Pounds to Kilograms
#include<stdio.h> int main() { const float KG = 0.453592; float pound; printf("Enter weight in pounds\n"); scanf("%f", £); printf("Weight in Kilograms is %f\n", (pound * KG) ); return 0; }
Output 1:
Enter weight in pounds
11
Weight in Kilograms is 4.989512
Output 2:
Enter weight in pounds
11.04
Weight in Kilograms is 5.007656
For list of all c programming interviews / viva question and answers visit: C Programming Interview / Viva Q&A List
For full C programming language free video tutorial list visit:C Programming: Beginner To Advance To Expert