From 7df5cef1797c23ed2ed090636e4d0825638686fc Mon Sep 17 00:00:00 2001 From: Sandro Welte Date: Thu, 8 Feb 2024 18:59:11 +0100 Subject: [PATCH] added type float to multiplication --- src/convert_ton_to_kg.c | 8 ++++++++ src/convert_ton_to_kg.h | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/convert_ton_to_kg.c create mode 100644 src/convert_ton_to_kg.h diff --git a/src/convert_ton_to_kg.c b/src/convert_ton_to_kg.c new file mode 100644 index 0000000..32b0f60 --- /dev/null +++ b/src/convert_ton_to_kg.c @@ -0,0 +1,8 @@ + +#include "convert_ton_to_kg.h" + + + +double tons_to_kg(double tons) { + return tons * 1000.0; // 1 ton = 1000 kilograms +} diff --git a/src/convert_ton_to_kg.h b/src/convert_ton_to_kg.h new file mode 100644 index 0000000..45a1b58 --- /dev/null +++ b/src/convert_ton_to_kg.h @@ -0,0 +1,12 @@ + + +#ifndef THEADMIRALS_CONVERT_TON_TO_KG_H +#define THEADMIRALS_CONVERT_TON_TO_KG_H + + + +double tons_to_kg(double tons); + + + +#endif //THEADMIRALS_CONVERT_TON_TO_KG_H