Browse Source

add Vaddx2

main
fdai6887 2 years ago
parent
commit
748da4a393
  1. 6
      src/funktion.c
  2. 1
      src/funktion.h
  3. 8
      src/main.c

6
src/funktion.c

@ -137,3 +137,9 @@ float Vadd(float x1, float z1) {
double result = x1 + z1; double result = x1 + z1;
return result; return result;
} }
float Vaddx2(float x2, float z2){
float X2;
X2 = x2 + z2;
printf("(%f: \n", X2);
return X2;
}

1
src/funktion.h

@ -26,5 +26,6 @@ double GewinnMaximum(double p,double q,double tc,double tr);
float Vshift(float x1,float s1); float Vshift(float x1,float s1);
double Vlength(float x1, float x2, float x3); double Vlength(float x1, float x2, float x3);
float Vadd(float x1, float z1); float Vadd(float x1, float z1);
float Vaddx2(float x2, float z2);
#endif #endif

8
src/main.c

@ -6,7 +6,7 @@
int main() 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'); a = getValue('a');
b = getValue('b'); b = getValue('b');
h = getValue('h'); h = getValue('h');
@ -112,4 +112,10 @@ int main()
x1 = getValue('x'); x1 = getValue('x');
z1 = getValue('z'); z1 = getValue('z');
Vadd(x1,z1); Vadd(x1,z1);
printf("y eingeben ");
x2 = getValue('X');
printf("b eingeben");
z2 = getValue('z');
Vaddx2(x2,z2);
} }
Loading…
Cancel
Save