1. 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

2. Hint: It doesn't do the calculations, because you never told it to do the calculations.

3. soooooo.....yaaa idk lol im just a beginner in all this :P

4. All the calculations are is getting the sum. So just add the second argument to the first.

Quzah.

5. Originally Posted by 123456tacos
soooooo.....yaaa idk lol im just a beginner in all this :P
C executes the main function by default, and no other function is executed by default. If you want to execute a function that is not main, you have to explicitly do so. You have not explicitly called the function that you have made. C isn't going to automatically figure out what you want the arguments to be and call the function for you.

Also,
printf("%.2f", arg); not printf("%2.f", arg);

6. ahahaha thanks i got it working DD