#include /**********************************************************/ struct complex { /* definicija kompleksnega stevila */ int real; int imag; }; /***********************************************************/ struct complex vsota (struct complex a, struct complex b) { /* funkcija vrne vsoto dveh kompleksnih stevil */ struct complex c; c.real = a.real + b.real; c.imag = a.imag + b.imag; return c; } /**********************************************************/ void main() { /* preizkus funkcije vsota */ struct complex a1, b1, c1; a1.real = 10; a1.imag = 14; b1.real = 15; b1.imag = 2; printf(" Prvi podatek je %d + i %d \n",a1.real, a1.imag); printf(" Drugi podatek je %d + i %d \n",b1.real, b1.imag); c1 = vsota (a1, b1); printf(" Vsota obeh je %d + i %d \n",c1.real, c1.imag); }