English

# Php Code for Complex Number

This php programming code is used to find the complex number. You can select the whole php code by clicking the select option and can use it. When you click text, the code will be changed to text format. This php program code will be opened in a new pop up window once you click pop-up from the right corner. You can just copy, paste this php code and use it to find the complex number.

```<?php
\$a1=5; \$b1=2; \$a2=7;\$b2=-4;
//Multiplication of complex number
\$m1=\$a1*\$a2;
\$m2=\$b1*(-(\$b2));
\$m3=\$a1*\$b2;
\$m4=\$a2*\$b1;
\$m5=(\$m1+\$m2);
\$m6=\$m3+\$m4;
if(\$m6>0)
printf("
Multiplication of complex num:".\$m5."+".\$m6."i");
else
printf("
Multiplication of complex num:".\$m5."".\$m6."i");
//Division of complex number
\$d=(\$a2*\$a2) +(\$b2*\$b2);
if(\$m6>0)
printf("
Division of complex num:(".\$m5."+".\$m6."i)/".\$d);
else
printf("
Division of complex num:(".\$m5."".\$m6."i)/".\$d);
//Squareroot of complex number
\$r1=(5*5)+(2*2);
\$r=sqrt(\$r1);
\$r2=(\$r-\$a1)/2;
\$y=sqrt(\$r2);
\$x=\$b1/(2*\$y);
printf("
Square Root: ".round(\$x,6)." +".round(\$y,6)."i");
printf("
Square Root:-".round(\$x,6)." -".round(\$y,6)."i");
?>```
##### Other Programming Codes
Online Calculator : Complex Number
Click on the select code link to copy and paste this free php program code for complex number.