From 88bcb5b190b37807c0cfb946dc3e743be2a6feed Mon Sep 17 00:00:00 2001 From: fdai6887 Date: Mon, 6 Feb 2023 21:07:47 +0100 Subject: [PATCH] add Vsubstract --- src/funktion.c | 6 ++++++ src/funktion.h | 1 + src/main.c | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/src/funktion.c b/src/funktion.c index 35dcbca..b17068c 100644 --- a/src/funktion.c +++ b/src/funktion.c @@ -145,3 +145,9 @@ float Vaddx3(float x3, float z3){ double result = x3 + z3; return result; } +float Vsubstract(float x1, float z1) { + float X1; + X1 = x1 - z1; + printf("(%f: \n", X1); + return X1; +} diff --git a/src/funktion.h b/src/funktion.h index 519e24a..6cda55b 100644 --- a/src/funktion.h +++ b/src/funktion.h @@ -28,5 +28,6 @@ double Vlength(float x1, float x2, float x3); float Vadd(float x1, float z1); float Vaddx2(float x2, float z2); float Vaddx3(float x3, float z3); +float Vsubstract(float x1, float z1); #endif diff --git a/src/main.c b/src/main.c index 8c47725..f9c1171 100644 --- a/src/main.c +++ b/src/main.c @@ -120,4 +120,10 @@ int main() x3 = getValue('X'); z3 = getValue('z'); Vaddx3(x3,z3); + + printf("x eingeben"); + x1 = getValue('x'); + printf("a eingeben"); + z1 = getValue('z'); + Vsubstract(x1, z1); }