diff --git a/src/convert_kg_to_ton.c b/src/convert_kg_to_ton.c new file mode 100644 index 0000000..51cea7a --- /dev/null +++ b/src/convert_kg_to_ton.c @@ -0,0 +1,6 @@ + +#include "convert_kg_to_ton.h" + +double kg_to_tons(double kilograms) { + return kilograms / 1000.0; // 1 ton = 1000 kilograms +} diff --git a/src/convert_kg_to_ton.h b/src/convert_kg_to_ton.h new file mode 100644 index 0000000..01f9369 --- /dev/null +++ b/src/convert_kg_to_ton.h @@ -0,0 +1,13 @@ + +#ifndef THEADMIRALS_CONVERT_KG_TO_TON_H +#define THEADMIRALS_CONVERT_KG_TO_TON_H + + + + +double kg_to_tons(double kilograms); + + + + +#endif //THEADMIRALS_CONVERT_KG_TO_TON_H