From 864272c3f440af7b81a700e5e0735c9a4e302a0e Mon Sep 17 00:00:00 2001 From: Sandro Welte Date: Thu, 8 Feb 2024 19:39:20 +0100 Subject: [PATCH] added kg to g converter --- src/convert_kg_to_g.c | 6 ++++++ src/convert_kg_to_g.h | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/convert_kg_to_g.c create mode 100644 src/convert_kg_to_g.h diff --git a/src/convert_kg_to_g.c b/src/convert_kg_to_g.c new file mode 100644 index 0000000..92bdd70 --- /dev/null +++ b/src/convert_kg_to_g.c @@ -0,0 +1,6 @@ + +#include "convert_kg_to_g.h" + +double kg_to_gram(double kilograms) { + return kilograms * 1000.0; // 1 kilogram = 1000 grams +} diff --git a/src/convert_kg_to_g.h b/src/convert_kg_to_g.h new file mode 100644 index 0000000..707a161 --- /dev/null +++ b/src/convert_kg_to_g.h @@ -0,0 +1,13 @@ + + +#ifndef THEADMIRALS_CONVERT_KG_TO_G_H +#define THEADMIRALS_CONVERT_KG_TO_G_H + + + + +double kg_to_gram(double kilograms); + + + +#endif //THEADMIRALS_CONVERT_KG_TO_G_H