From 748da4a393626cd9eec757ebb34e10b28791c1d5 Mon Sep 17 00:00:00 2001 From: fdai6887 Date: Mon, 6 Feb 2023 20:52:36 +0100 Subject: [PATCH] add Vaddx2 --- src/funktion.c | 6 ++++++ src/funktion.h | 1 + src/main.c | 8 +++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/funktion.c b/src/funktion.c index a0d2f34..db5cd96 100644 --- a/src/funktion.c +++ b/src/funktion.c @@ -137,3 +137,9 @@ float Vadd(float x1, float z1) { double result = x1 + z1; return result; } +float Vaddx2(float x2, float z2){ + float X2; + X2 = x2 + z2; + printf("(%f: \n", X2); + return X2; +} diff --git a/src/funktion.h b/src/funktion.h index 6f0b4e1..207dfd0 100644 --- a/src/funktion.h +++ b/src/funktion.h @@ -26,5 +26,6 @@ double GewinnMaximum(double p,double q,double tc,double tr); float Vshift(float x1,float s1); double Vlength(float x1, float x2, float x3); float Vadd(float x1, float z1); +float Vaddx2(float x2, float z2); #endif diff --git a/src/main.c b/src/main.c index 0280e8f..1f1d6a3 100644 --- a/src/main.c +++ b/src/main.c @@ -6,7 +6,7 @@ int main() { - double a,b,c,d,h,x1,s1,x2,x3,z1; + double a,b,c,d,h,x1,s1,x2,x3,z1,z2; a = getValue('a'); b = getValue('b'); h = getValue('h'); @@ -112,4 +112,10 @@ int main() x1 = getValue('x'); z1 = getValue('z'); Vadd(x1,z1); + + printf("y eingeben "); + x2 = getValue('X'); + printf("b eingeben"); + z2 = getValue('z'); + Vaddx2(x2,z2); }