MUstar

IoT C언어 0424 - 실습1

Apr 23rd, 2017
73
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. double centi_to_meter(int cm);
  4. int main(void)
  5. {
  6.     double mm1;
  7.     mm1 = centi_to_meter(185);
  8.     printf("%.2lfm\n", mm1);
  9.  
  10.     return 0;
  11. }
  12. double centi_to_meter (int cm)
  13. {
  14.     double mm2;
  15.     mm2 = (double)cm / 100;
  16.  
  17.     return mm2;
  18. }
RAW Paste Data