Browse Source

multiplication by percentage

remotes/origin/multiplication
fdai7930 11 months ago
parent
commit
8a60c03078
  1. 3
      src/multiplication.c
  2. 1
      src/multiplication.h

3
src/multiplication.c

@ -24,6 +24,9 @@ int multiply_by_ten(int a) {
return a * 10; return a * 10;
} }
float multiply_by_percentage(float num, float percentage) {
return num * (percentage / 100);
}

1
src/multiplication.h

@ -6,5 +6,6 @@ int multiply_three_integers(int a, int b, int c);
int multiply_left_shift(int a, int b); int multiply_left_shift(int a, int b);
int multiply_right_shift(int a, int b); int multiply_right_shift(int a, int b);
int multiply_by_ten(int a); int multiply_by_ten(int a);
float multiply_by_percentage(float num, float percentage);
#endif // MULTIPLICATION_H #endif // MULTIPLICATION_H
Loading…
Cancel
Save