*sigh* Okay, here we go.
Main reason for segmentation fault here was your result function. When you called it you passed only one argument while definiton of your function expected many more. Declaration of result differed from its definition as well which was extra confusing. What's more even when function would get called successfully it still would have printed garbage because other operation values weren't computed. For example - if user chose addition, then sub, multiple and divi wouldn't have their values set because their functions were never called in the first place.
To fix this result function should print result of only and exactly one operation.
Besides that results of operations were returned with the type of integer (int) which would be fine in some cases but it is unacceptable for division and operations with fractions. Instead, float or double should be used.
Import of math.h wasn't neccessary so I removed it as well as vertical tabs in your menu since they look kinda ugly. Anyways, here's revised code of your program:
#include <stdio.h>
void getValue(float *number1, float *number2);
float addition(float number1, float number2);
float subtract(float number1, float number2);
float multiply(float number1, float number2);
float divide(float number1, float number2);
void result(float *value, char *message);
char* msg[] = {
"sum",
"sub",
"multiple",
"divi",
};
int main()
{
float number1, number2, res;
int choice = 0;
printf("[0] Exit\n[1] Add\n[2] Subtract\n[3] Multiply\n[4] Divide\n");
scanf("%d", &choice);
switch(choice)
{
case 0:
return 0;
case 1:
getValue(&number1, &number2);
res = addition(number1,number2);
break;
case 2:
getValue(&number1, &number2);
res = subtract(number1,number2);
break;
case 3:
getValue(&number1, &number2);
res = multiply(number1,number2);
break;
case 4:
getValue(&number1, &number2);
res = divide(number1,number2);
break;
default:
printf("That is not a valid choice.");
return 0;
}
result(&res, msg[choice - 1]);
return 0;
}
void getValue(float *number1, float *number2)
{
printf("\nenter the number1 = ");
scanf("%f",number1);
printf("enter the number2 = ");
scanf("%f",number2);
}
float addition(float number1, float number2)
{
return number1 + number2;
}
float subtract(float number1, float number2)
{
return number1 - number2;
}
float multiply(float number1, float number2)
{
return number1 * number2;
}
float divide(float number1, float number2)
{
return number1 / number2;
}
void result(float *value, char *message)
{
printf("\n%s is = %.2f",message, *value);
}