We include the header file complex.h and define four different complex variables. These are a=0.1+\imath 1.3 , b=3.0+\imath 0 (note that if you don't define a value for the imaginary part this is set to zero), c=5.0-\imath 2.3 and d=b . Thereafter we have defined standard algebraic operations and the member functions of the class which allows us to print out the real and imaginary part of a given variable.