Browse Source

refactoring: changed descriptions and edited layout

remotes/origin/develop
Eric Bagus 11 months ago
parent
commit
bdac4949b0
  1. 4
      src/arithmeticMultiplication_Int.c
  2. 10
      src/arithmeticSubtraction.c

4
src/arithmeticMultiplication_Int.c

@ -1,15 +1,11 @@
#include "arithmeticMultiplication_Int.h" #include "arithmeticMultiplication_Int.h"
#include <stdlib.h> #include <stdlib.h>
int* multiplication_integer(int a, int b) { int* multiplication_integer(int a, int b) {
int *result = (int*)malloc(sizeof(int)); int *result = (int*)malloc(sizeof(int));
if (result == NULL) { if (result == NULL) {
return NULL; return NULL;
} }
*result = a * b; *result = a * b;
return result; return result;

10
src/arithmeticSubtraction.c

@ -1,20 +1,22 @@
#include "arithmeticSubtraction.h" #include "arithmeticSubtraction.h"
#include <stdlib.h> #include <stdlib.h>
//arithmetic Subtraction specification integer
// arithmetic subtraction integer
int* subtraction_integer(int a, int b) { int* subtraction_integer(int a, int b) {
int* result= malloc(sizeof (int)); int* result= malloc(sizeof (int));
*result=a - b; *result=a - b;
return result; return result;
} }
//arithmetic Subtraction specification float
// arithmetic subtraction float
float* subtraction_float(float a, float b) { float* subtraction_float(float a, float b) {
float* result= malloc(sizeof (float)); float* result= malloc(sizeof (float));
*result=a - b; *result=a - b;
return result; return result;
} }
//arithmetic Subtraction specification double
// arithmetic subtraction double
double* subtraction_double(double a, double b) { double* subtraction_double(double a, double b) {
double* result= malloc(sizeof (double)); double* result= malloc(sizeof (double));
*result=a - b; *result=a - b;

Loading…
Cancel
Save