Browse Source

added kg to g converter

remotes/origin/develop
Sandro Welte 11 months ago
parent
commit
864272c3f4
  1. 6
      src/convert_kg_to_g.c
  2. 13
      src/convert_kg_to_g.h

6
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
}

13
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
Loading…
Cancel
Save