C Program To Convert Pounds to Kilograms

Lets write a C program to Convert weight from Pounds to Kilograms.

Note: 1 Pound is approximately equal to 0.453592 Kilogram.

pound to kilogram

Formula To Convert Weight From Pounds to Kilograms

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

Logic To Convert Pounds to Kilograms

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



YouTube Link: https://www.youtube.com/watch?v=-MmRvZ538f4 [Watch the Video In Full Screen.]

Source Code: C Program To Convert Pounds to Kilograms

  1. #include<stdio.h>  
  2.   
  3. int main()  
  4. {  
  5.     const float KG = 0.453592;  
  6.           float pound;  
  7.   
  8.     printf("Enter weight in pounds\n");  
  9.     scanf("%f", &pound);  
  10.   
  11.     printf("Weight in Kilograms is %f\n", (pound * KG) );  
  12.   
  13.     return 0;  
  14. }  

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

C Program To Convert Kilograms to Pounds

Lets write a C program to Convert weight from Kilograms to Pounds.

Note: 1 Kilogram is approximately equal to 2.20462 Pound.

kilogram to pound

Formula To Convert Weight From Kilograms to Pounds

pound = kilogram * 2.20462;

Related Read:
Keywords, Constants, Variables: C
Basic Arithmetic Operations In C

Logic To Convert Kilograms to Pounds

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



YouTube Link: https://www.youtube.com/watch?v=puxuafYkOh0 [Watch the Video In Full Screen.]

Source Code: C Program To Convert Kilograms to Pounds

  1. #include<stdio.h>  
  2.   
  3. int main()  
  4. {  
  5.     const float POUND = 2.20462;  
  6.     float kg;  
  7.   
  8.     printf("Enter weight in Kilograms\n");  
  9.     scanf("%f", &kg);  
  10.   
  11.     printf("Weight in Pounds is %f\n", (kg * POUND));  
  12.   
  13.     return 0;  
  14. }  

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

C Program To Determine Weight Class of a Boxer

In boxing the weight class of a boxer is decided as per the following table. Write a C program that receives weight as input and prints out the boxer’s weight class.

Boxer Class Weight In Pounds
Flyweight < 115
Bantamweight 115 – 121
Featherweight 122 – 153
Middleweight 154 – 189
Heavyweight >= 190

Related Read:
else if statement in C
Relational Operators In C

Expected Output for the Input

User Input:
Enter boxers weight in pounds
500

Output:
Boxer is of weight class Heavyweight

Video Tutorial: C Program To Determine Weight Class of a Boxer



YouTube Link: https://www.youtube.com/watch?v=sAvmrWLplPU [Watch the Video In Full Screen.]

Source Code: C Program To Determine Weight Class of a Boxer

  1. #include < stdio.h >  
  2.   
  3. int main()  
  4. {  
  5.     int wt;  
  6.   
  7.     printf("Enter boxers weight in pounds\n");  
  8.     scanf("%d", &wt);  
  9.   
  10.     if(wt < 115)  
  11.     {  
  12.         printf("Boxer is of weight class Flyweight\n");  
  13.     }  
  14.     else if(wt >= 115 && wt <= 121)  
  15.     {  
  16.         printf("Boxer is of weight class Bantamweight\n");  
  17.     }  
  18.     else if(wt >= 122 && wt <= 153)  
  19.     {  
  20.         printf("Boxer is of weight class Featherweight\n");  
  21.     }  
  22.     else if(wt >= 154 && wt <= 189)  
  23.     {  
  24.         printf("Boxer is of weight class Middleweight\n");  
  25.     }  
  26.     else if(wt >= 190)  
  27.     {  
  28.         printf("Boxer is of weight class Heavyweight\n");  
  29.     }  
  30.   
  31.     return 0;  
  32. }  

Output 1:
Enter boxers weight in pounds
108
Boxer is of weight class Flyweight

Output 2:
Enter boxers weight in pounds
120
Boxer is of weight class Bantamweight

Output 3:
Enter boxers weight in pounds
140
Boxer is of weight class Featherweight

Output 4:
Enter boxers weight in pounds
180
Boxer is of weight class Middleweight

Output 5:
Enter boxers weight in pounds
200
Boxer is of weight class Heavyweight

boxers weight class

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