You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

13 lines
335 B

#include "arithmeticAddition.h"
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
int* addition_integer(int num1, int num2) {
if ((num2 > 0 && num1 > INT_MAX - num2) || (num2 < 0 && num1 < INT_MIN - num2)) {
return NULL;
}
int* result = malloc(sizeof(int));
*result = num1 + num2;
return result;
}