Hi,
I have write out a code that use a pointer and print out the sum of two squared value. I am not sure where i go wrong in the code, can anyone correct my error??
Thanks.
Code:#include <stdio.h> int sumsq(int *a, int *b); int main(void) { printf("Sum of 4 square and 2 square (passed by reference) is %d", sumsq(4, 2)); int sumsq(); return(0); } int sumsq(int *a, int *b) { int *sum; *sum = (*a * *a) + (*b * *b); printf("%d", *sum); return (*sum); }