I have listed my code. My numbers are being read but the product and sum are not displaying the correct answer. What am I missing? Any suggestions?
Code:
#include <stdio.h>
void sum_product(int* x, int* y);
void main()
{
int num1;
int num2;
double product;
int sum;
printf("Enter two integers: ");
scanf("%d%d", &num1, &num2);
printf("The # is %d and %d\n", num1, num2);
sum_product(&num1, &num2);
printf("The sum is %d\n", &sum);
printf("The product is %d\n", &product);
}
void sum_product(int *x, int *y)
{
double *product = (*x) * (*y);
int *sum = *x+*y;
}