|
|
@ -21,32 +21,6 @@ int choose_program() { |
|
|
|
return choice; |
|
|
|
} |
|
|
|
|
|
|
|
int addThreeNumbers(int num1, int num2, int num3) { |
|
|
|
return num1 + num2 + num3; |
|
|
|
} |
|
|
|
|
|
|
|
int multiply(int num1, int num2) { |
|
|
|
return num1 * num2; |
|
|
|
} |
|
|
|
|
|
|
|
int subtract(int num1, int num2) { |
|
|
|
return num1 - num2; |
|
|
|
} |
|
|
|
|
|
|
|
int divide(int num1, int num2) { |
|
|
|
return num1 / num2; |
|
|
|
} |
|
|
|
|
|
|
|
int power(int base, int power) { |
|
|
|
int speicher = 1; |
|
|
|
|
|
|
|
for (int i = 0; i < power; i++) { |
|
|
|
speicher *= base; |
|
|
|
} |
|
|
|
|
|
|
|
return speicher; |
|
|
|
} |
|
|
|
|
|
|
|
int x_wins_00_10_20(char board[][3]) { |
|
|
|
if (board[0][0] == 'X' && board[1][0] == 'X' && board[2][0] == 'X') { |
|
|
|
return 1; |
|
|
@ -95,6 +69,12 @@ int x_wins_02_11_20(char board[][3]) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
int o_wins_00_10_20(char board[][3]) { |
|
|
|
if (board[0][0] == 'O' && board[1][0] == 'O' && board[2][0] == 'O') { |
|
|
|
return 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
int stringCharacterCounter(char string[]) { |
|
|
|
int stringLength = 0; |
|
|
|
|
|
|
@ -117,12 +97,30 @@ int characterAppearanceInString(char c, char string[]) { |
|
|
|
return appear; |
|
|
|
} |
|
|
|
|
|
|
|
int calculateCurrent(int voltage, int resistance) { |
|
|
|
return voltage / resistance; |
|
|
|
int addThreeNumbers(int num1, int num2, int num3) { |
|
|
|
return num1 + num2 + num3; |
|
|
|
} |
|
|
|
|
|
|
|
int calculatePressure(int force, int area) { |
|
|
|
return force / area; |
|
|
|
int multiply(int num1, int num2) { |
|
|
|
return num1 * num2; |
|
|
|
} |
|
|
|
|
|
|
|
int subtract(int num1, int num2) { |
|
|
|
return num1 - num2; |
|
|
|
} |
|
|
|
|
|
|
|
int divide(int num1, int num2) { |
|
|
|
return num1 / num2; |
|
|
|
} |
|
|
|
|
|
|
|
int power(int base, int power) { |
|
|
|
int speicher = 1; |
|
|
|
|
|
|
|
for (int i = 0; i < power; i++) { |
|
|
|
speicher *= base; |
|
|
|
} |
|
|
|
|
|
|
|
return speicher; |
|
|
|
} |
|
|
|
|
|
|
|
// Function to calculate the sine of an angle in radians |
|
|
@ -329,10 +327,14 @@ float remainderValue(float x, float y) { |
|
|
|
return fmod(x, y); |
|
|
|
} |
|
|
|
|
|
|
|
float f(float m) { |
|
|
|
return m * 9.81; |
|
|
|
} |
|
|
|
|
|
|
|
float calculateWeight(float mass) { |
|
|
|
return mass * 9.81; |
|
|
|
} |
|
|
|
|
|
|
|
int calculateCurrent(int voltage, int resistance) { |
|
|
|
return voltage / resistance; |
|
|
|
} |
|
|
|
|
|
|
|
int calculatePressure(int force, int area) { |
|
|
|
return force / area; |
|
|
|
} |