Problem : . Function with Input/Output Parameters
Write a void function called Result that has only two type int input/output parameters. The function will return the sum of the two original parameters through the first parameter. It will also return the differences of the two original parameters through the second parameter.
Write a main function to test this function
Need help does not do calculations D:
Code:
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
void result(double *smp, double *lgp);
int
main(void)
{
double num1, num2;
/* Gets test data */
printf("Enter the first number");
scanf("%lf", &num1);
printf("Enter the second number");
scanf("%lf", &num2);
printf("The first number is %2.f", num1);
printf("The second number is %2.f", num2);
system("pause");
return (0);
}
void
result(double *num2, double *num1)
{
double temp = *num1;
*num1 = *num1 + *num2;
*num2 = temp - *num2;
}
it should run like the pic above