Check if it's a square or rectangle
Simplify the if by just doing

if (first == second &amp;&amp; second == third &amp;&amp; third == fourth)
{....}


You said the inputs are degrees, now it’s been awhile since geometry but squares and rectangles are determined by length of side, not angle degree. Both are 4 sided objects so every angle is the same (unless you’re talking about something like a trapezoid, rhombus).