The sum of the angles a regular polygon is

180(n-2)

And there are n angles as well as sides.

Thus, each angle has,

Degree.Code:180(n-2) ---------- n

The sum of all exterior angles is always 360 degree.

Divided by the number of angles n thus each one has,

By the conditions of the problem you are trying to solve,Code:360 ---- n

Code:180(n-2) 4*360 ------------ = ---- n n