English

# Cpp Code for Polar Representation of Complex Numbers

This cpp programming code is used to find the polar representation of complex numbers. You can select the whole cpp code by clicking the select option and can use it. When you click text, the code will be changed to text format. This cpp 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 cpp code and use it to find the polar representation of complex numbers.

```#include <iostream>
#include<math.h>
using namespace std;
int main()
{
double x,y,z;
x=4;
y=5;
z=y;

//If "-" Operator
y=-1*y;

double r=sqrt(x*x+y*y);
double t=atan(y/x);
t=t*180/3.14;
r=round(r*1000)/1000;
t=ceil(t);
cout<<"
Polar representation (z): "<<r<<"( cos "<<t<<"(deg) + i sin "<<t<<"(deg))";

//If "+" Operator
z=z*1;

r=sqrt(x*x+z*z);
t=atan(z/x);
t=t*180/3.14;
r=round(r*1000)/1000;
t=ceil(t);
cout<<"
Polar representation (z): "<<r<<"( cos "<<t<<"(deg) + i sin "<<t<<"(deg))";
return 0;
}
```
##### Other Programming Codes
Click on the select code link to copy and paste this free cpp program code for polar representation of complex numbers.