Advertisement
Guest User

Untitled

a guest
Aug 31st, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. /*Program chapter 2_23*/
  2.  
  3. /*This program converts pounds to kilograms.*/
  4.  
  5. #include <stdio.h>
  6. #include <math.h>
  7.  
  8. int main(void)
  9. {
  10. /*Declare variables.*/
  11. float lb, kg;
  12. lb = 0;
  13. kg = 0;
  14. printf("This program converts Pounds (Lb) to Kg .\n");
  15. printf("Please enter the weight in pounds: ");
  16. scanf_s("%f",lb);
  17. kg = lb / 2.205;
  18. printf("The weight in kilograms is %f", kg);
  19.  
  20. /*Pause for user input and exit program.*/
  21. return 0;
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement