Hello, I just need help with this exercise:
So Z1=5+3i
and Z2=-2-5i
The sum is 3-2i. But how can I print it? The code i wrote here prints me 3 4198924 i. What am I doing wrong?
Code:
#include <stdio.h>
int a,b,c,d;
int COMPSUM(int a,int b,int c,int d);
int main()
{
//int a,b,c,d;
printf("Enter first complex number real part:\n");
scanf("%d\n",&a);
printf("Enter first complex number imaginary part:\n");
scanf("%d\n",&b);
printf("Enter second complex number real part:\n");
scanf("%d\n",&c);
printf("Enter second complex number imaginary part:\n");
scanf("%d\n",&d);
printf("%d %d i\n",COMPSUM(a,b,c,d));
return 0;
}
int COMPSUM(int a,int b,int c,int d){
int e,f;
e=a+c;
f=b+d;
return e,f;
}