Lets write a C program to Convert weight from Kilograms to Pounds.
Note: 1 Kilogram is approximately equal to 2.20462 Pound.
Page Contents
pound = kilogram * 2.20462;
Related Read:
Keywords, Constants, Variables: C
Basic Arithmetic Operations In C
First we ask the user to enter weight / mass in kilograms. Then we multiply that value with 2.20462. The result itself is the pound equivalent of user entered weight in KG.
Video Tutorial: C Program To Convert Kilograms to Pounds
#include<stdio.h>
int main()
{
const float POUND = 2.20462;
float kg;
printf("Enter weight in Kilograms\n");
scanf("%f", &kg);
printf("Weight in Pounds is %f\n", (kg * POUND));
return 0;
}
Output 1:
Enter weight in Kilograms
5
Weight in Pounds is 11.023099
Output 2:
Enter weight in Kilograms
14
Weight in Pounds is 30.864678
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