You have:
polar();radius(0),angle(0){}
but it should really be:
polar():radius(0),angle(0){}
And then after fixing that you have:
polar(rectangular r)
Which should really be:
polar(rectangular<S> r)
And then after that you have:
void main()
Which should really be:
int main()
And then after that you have:
p.display_rect();
Which should be:
r.display_rect();
And then after that you have:
p.display_polar()
Which should really be:
p.display_polar();
And then after fixing all the typos you have:
p=r;
Which will never work because rectangular and polar are not related to each other so you can't assign them.
You do have a constructor, but you constructed p using the default constructor. Instead, you need to delete:
polar<double> p;
And replace:
p=r;
With:
polar<double> p(r);
And then finally you need to include the header for cout, endl, sqrt and atan:
#include <cmath>
using std::sqrt;
using std::atan;
#include <iostream>
using std::cout;
using std::endl;
You really shouldn't be using std::endl - it flushes the output queue which slows down the whole program. You probably wanted to use "\n" instead of endl.
Here is a running version: https://onlinegdb.com/eTYzZe8OR