May be you are seeking for this:
printf("Roots are complex and different.
");
printf("x1 = %lf+%lfi
",realPart,imaginaryPart);
printf("x2 = %lf-%lfi
",realPart,imaginaryPart);
if realPart
and imaginaryPart
variables are in data type double
.
Use %f
for float
, %d
for int
, %s
for string
instead of %lf
in the code otherwise.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…