I was making a complex number calculator using struct, here is my printf function
printf("%d%c%di", sum.real, sign, sum.imag);
I can everything correct except one thing, when the sum.imag part is 1 or -1 ofcourse it prints out "1i" or "-1i" respectively, is there a way apart from using a lot of "if"s that i can format the printf function where if sum.imag is 1 or -1 it shouldn't print the value instead print just the "i"??