Dido09

C - Converter

Feb 28th, 2022 (edited)
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.  
  6. float inch, mm,cm,dm,m;
  7. printf("\nEnter length in Inch: ");
  8. scanf("%f", &inch);
  9.  
  10. cm = inch * 2.54;
  11. mm = inch * 25.4;
  12. dm = inch * 0.254;
  13. m = inch * 0.0254;
  14.  
  15. printf("\nEquivalent length in Centimeters = %0.2f", cm);
  16. printf("\nEquivalent length in Millimeters = %0.2f", mm);
  17. printf("\nEquivalent length in Decimeters = %0.2f", dm);
  18. printf("\nEquivalent length in Meters = %0.2f", m);
  19.  
  20.  
  21. return 0;
  22. }
  23.  
Add Comment
Please, Sign In to add comment