Check if it is possible to create a polygon with a given angle | C ++ implementation of above approach ; Function to check whether it is possible to make a regular polygon with a given angle . ; N denotes the number of sides of polygons possible ; Driver code ; function to print the required answer
#include <bits/stdc++.h> NEW_LINE using namespace std ; void makePolygon ( float a ) { float n = 360 / ( 180 - a ) ; if ( n == ( int ) n ) cout << " YES " ; else cout << " NO " ; } int main ( ) { float a = 90 ; makePolygon ( a ) ; return 0 ; }