codeparrot/xlcost-text-to-code huggingface dataset:
Count cubes of size K inscribed in a cube of size N | C ++ implementation of the above approach ; Function to find the number of the cubes of the size K ; Stores the number of cubes ; Stores the number of cubes of size k ; Driver Code ; Size of the bigger cube ; Size of the smaller cube
#include <bits/stdc++.h> NEW_LINE using namespace std ; int No_of_cubes ( int N , int K ) { int No = 0 ; No = ( N - K + 1 ) ; No = pow ( No , 3 ) ; return No ; } int main ( ) { int N = 5 ; int K = 2 ; cout << No_of_cubes ( N , K ) ; return 0 ; }
Count of smaller rectangles that can be placed inside a bigger rectangle | C ++ program for the above approach ; Function to count smaller rectangles within the larger rectangle ; If the dimension of the smaller rectangle is greater than the bigger one ; Return the number of smaller rectangles possible ; Driver Code ; Dimension of bigger rectangle ; Dimension of smaller rectangle ; Function call
#include <bits/stdc++.h> NEW_LINE using namespace std ; int No_of_rectangles ( int L , int B , int l , int b ) { if ( ( l > L ) || ( b > B ) ) { return -1 ; } else { return ( L - l + 1 ) * ( B - b + 1 ) ; } } int main ( ) { int L = 5 , B = 3 ; int l = 4 , b = 1 ; cout << No_of_rectangles ( L , B , l , b ) ; return 0 ; }
Program To Check whether a Triangle is Equilateral , Isosceles or Scalene | C ++ program for the above approach ; Function to check if the triangle is equilateral or isosceles or scalene ; Check for equilateral triangle ; Check for isosceles triangle ; Otherwise scalene triangle ; Driver Code ; Given sides of triangle ; Function call
#include <bits/stdc++.h> NEW_LINE using namespace std ; void checkTriangle ( int x , int y , int z ) { if ( x == y && y == z ) cout << " Equilateral ▁ Triangle " ; else if ( x == y y == z z == x ) cout << " Isosceles ▁ Triangle " ; else cout << " Scalene ▁ Triangle " ; } int main ( ) { int x = 8 , y = 7 , z = 9 ; checkTriangle ( x , y , z ) ; }
Find the remaining vertices of a square from two given vertices | C ++ program for the above approach ; Function to find the remaining vertices of a square ; Check if the x - coordinates are equal ; Check if the y - coordinates are equal ; If the the given coordinates forms a diagonal of the square ; Otherwise ; Square does not exist ; Driver Code ; Given two vertices
#include <cstdlib> NEW_LINE #include <iostream> NEW_LINE using namespace std ; void findVertices ( int x1 , int y1 , int x2 , int y2 ) { if ( x1 == x2 ) { cout << ( x1 + y2 - y1 ) << " , ▁ " << y1 << endl ; cout << ( x2 + y2 - y1 ) << " , ▁ " << y2 ; } else if ( y1 == y2 ) { cout << x1 << " , ▁ " << ( y1 + x2 - x1 ) << endl ; cout << x2 << " , ▁ " << ( y2 + x2 - x1 ) ; } else if ( abs ( x2 - x1 ) == abs ( y2 - y1 ) ) { cout << x1 << " , ▁ " << y2 << endl ; cout << x2 << " , ▁ " << y1 ; } else cout << " - 1" ; } int main ( ) { int x1 = 1 , y1 = 2 ; int x2 = 3 , y2 = 4 ; findVertices ( x1 , y1 , x2 , y2 ) ; return 0 ; }
Find the area of rhombus from given Angle and Side length | C ++ Program to calculate area of rhombus from given angle and side length ; Function to return the area of rhombus using one angle and side . ; Driver Code ; Function Call ; Print the final answer
#include <bits/stdc++.h> NEW_LINE using namespace std ; #define RADIAN  0.01745329252 NEW_LINE float Area_of_Rhombus ( int a , int theta ) { float area = ( a * a ) * sin ( ( RADIAN * theta ) ) ; return area ; } int main ( ) { int a = 4 ; int theta = 60 ; float ans = Area_of_Rhombus ( a , theta ) ; printf ( " % 0.2f " , ans ) ; return 0 ; }
Count of Equilateral Triangles of unit length possible from a given Hexagon | C ++ program to implement the above approach ; Function to calculate the the number of Triangles possible ; Driver Code ; Regular Hexagon ; Irregular Hexagon
#include <bits/stdc++.h> NEW_LINE using namespace std ; int calculateTriangles ( int sides [ ] ) { double count = pow ( sides [ 0 ] + sides [ 1 ] + sides [ 2 ] , 2 ) ; count -= pow ( sides [ 0 ] , 2 ) ; count -= pow ( sides [ 2 ] , 2 ) ; count -= pow ( sides [ 4 ] , 2 ) ; return ( int ) ( count ) ; } int main ( ) { int sides [ ] = { 1 , 1 , 1 , 1 , 1 , 1 } ; cout << ( calculateTriangles ( sides ) ) << endl ; int sides1 [ ] = { 2 , 2 , 1 , 3 , 1 , 2 } ; cout << ( calculateTriangles ( sides1 ) ) << endl ; return 0 ; }
Length of diagonal of a parallelogram using adjacent sides and angle between them | C ++ program to find length Of diagonal of a parallelogram Using sides and angle between them . ; Function to return the length Of diagonal of a parallelogram using sides and angle between them . ; Driver Code ; Given sides ; Given angle ; Function call ; Print the final answer
#include <bits/stdc++.h> NEW_LINE using namespace std ; #define PI  3.147 NEW_LINE double Length_Diagonal ( int a , int b , double theta ) { double diagonal = sqrt ( ( pow ( a , 2 ) + pow ( b , 2 ) ) - 2 * a * b * cos ( theta * ( PI / 180 ) ) ) ; return diagonal ; } int main ( ) { int a = 3 ; int b = 5 ; double theta = 45 ; double ans = Length_Diagonal ( a , b , theta ) ; printf ( " % .2f " , ans ) ; }
Maximum number of tiles required to cover the floor of given size using 2 x1 size tiles | C ++ program for the above approach ; Function to find the maximum number of tiles required to cover the floor of size m x n using 2 x 1 size tiles ; Print the answer ; Driver Code ; Given M and N ; Function Call
#include <bits/stdc++.h> NEW_LINE using namespace std ; void maximumTiles ( int n , int m ) { cout << ( m * n ) / 2 << endl ; } int main ( ) { int M = 3 ; int N = 4 ; maximumTiles ( N , M ) ; return 0 ; }
Length of a Diagonal of a Parallelogram using the length of Sides and the other Diagonal | C ++ Program to implement the above approach ; Function to calculate the length of the diagonal of a parallelogram using two sides and other diagonal ; Driver Code ; Function Call ; Print the final answer
#include <bits/stdc++.h> NEW_LINE using namespace std ; float Length_Diagonal ( int a , int b , int d ) { float diagonal = sqrt ( 2 * ( ( a * a ) + ( b * b ) ) - ( d * d ) ) ; return diagonal ; } int main ( ) { int A = 10 ; int B = 30 ; int D = 20 ; float ans = Length_Diagonal ( A , B , D ) ; printf ( " % 0.1f " , ans ) ; return 0 ; }
Length of Diagonals of a Cyclic Quadrilateral using the length of Sides . | C ++ Program to implement the above approach ; Function to calculate the length of diagonals of a cyclic quadrilateral ; Driver Code ; Function Call ; Print the final answer
#include <bits/stdc++.h> NEW_LINE using namespace std ; vector < float > Diagonals ( int a , int b , int c , int d ) { vector < float > ans ; ans . push_back ( sqrt ( ( ( a * c ) + ( b * d ) ) * ( ( a * d ) + ( b * c ) ) / ( ( a * b ) + ( c * d ) ) ) ) ; ans . push_back ( sqrt ( ( ( a * c ) + ( b * d ) ) * ( ( a * b ) + ( c * d ) ) / ( ( a * d ) + ( b * c ) ) ) ) ; return ans ; } int main ( ) { int A = 10 ; int B = 15 ; int C = 20 ; int D = 25 ; vector < float > ans = Diagonals ( A , B , C , D ) ; printf ( " % .2f ▁ % .2f " , ( ans [ 0 ] ) + .01 , ans [ 1 ] + .01 ) ; }
Minimum Sum of Euclidean Distances to all given Points | C ++ Program to implement the above approach ; Function to calculate Euclidean distance ; Function to calculate the minimum sum of the euclidean distances to all points ; Calculate the centroid ; Calculate distance of all points ; Driver Code ; Initializing the points
#include <bits/stdc++.h> NEW_LINE using namespace std ; double find ( double x , double y , vector < vector < int > > & p ) { double mind = 0 ; for ( int i = 0 ; i < p . size ( ) ; i ++ ) { double a = p [ i ] [ 0 ] , b = p [ i ] [ 1 ] ; mind += sqrt ( ( x - a ) * ( x - a ) + ( y - b ) * ( y - b ) ) ; } return mind ; } double getMinDistSum ( vector < vector < int > > & p ) { double x = 0 , y = 0 ; for ( int i = 0 ; i < p . size ( ) ; i ++ ) { x += p [ i ] [ 0 ] ; y += p [ i ] [ 1 ] ; } x = x / p . size ( ) ; y = y / p . size ( ) ; double mind = find ( x , y , p ) ; return mind ; } int main ( ) { vector < vector < int > > vec = { { 0 , 1 } , { 1 , 0 } , { 1 , 2 } , { 2 , 1 } } ; double d = getMinDistSum ( vec ) ; cout << d << endl ; return 0 ; }
Coplanarity of Two Lines in 3D Geometry | C ++ program implement the above approach ; Function to generate determinant ; Return the sum ; Driver Code ; Position vector of first line ; Direction ratios of line to which first line is parallel ; Position vectors of second line ; Direction ratios of line to which second line is parallel ; Determinant to check coplanarity ; If determinant is zero ; Otherwise
#include <iostream> NEW_LINE using namespace std ; int det ( int d [ ] [ 3 ] ) { int Sum = d [ 0 ] [ 0 ] * ( ( d [ 1 ] [ 1 ] * d [ 2 ] [ 2 ] ) - ( d [ 2 ] [ 1 ] * d [ 1 ] [ 2 ] ) ) ; Sum -= d [ 0 ] [ 1 ] * ( ( d [ 1 ] [ 0 ] * d [ 2 ] [ 2 ] ) - ( d [ 1 ] [ 2 ] * d [ 2 ] [ 0 ] ) ) ; Sum += d [ 0 ] [ 2 ] * ( ( d [ 0 ] [ 1 ] * d [ 1 ] [ 2 ] ) - ( d [ 0 ] [ 2 ] * d [ 1 ] [ 1 ] ) ) ; return Sum ; } int main ( ) { int x1 = -3 , y1 = 1 , z1 = 5 ; int a1 = -3 , b1 = 1 , c1 = 5 ; int x2 = -1 , y2 = 2 , z2 = 5 ; int a2 = -1 , b2 = 2 , c2 = 5 ; int det_list [ 3 ] [ 3 ] = { { x2 - x1 , y2 - y1 , z2 - z1 } , { a1 , b1 , c1 } , { a2 , b2 , c2 } } ; if ( det ( det_list ) == 0 ) { cout << " Lines ▁ are ▁ coplanar " << endl ; } else { cout << " Lines ▁ are ▁ non ▁ coplanar " << endl ; } return 0 ; }
Distance between Incenter and Circumcenter of a triangle using Inradius and Circumradius | C ++ 14 program for the above approach ; Function returns the required distance ; Driver code ; Length of Inradius ; Length of Circumradius
#include <bits/stdc++.h> NEW_LINE using namespace std ; double distance ( int r , int R ) { double d = sqrt ( pow ( R , 2 ) - ( 2 * r * R ) ) ; return d ; } int main ( ) { int r = 2 ; int R = 5 ; cout << ( round ( distance ( r , R ) * 100.0 ) / 100.0 ) ; }
Find N random points within a Circle | C ++ program for the above approach ; Return a random double between 0 & 1 ; Function to find the N random points on the given circle ; Result vector ; Get Angle in radians ; Get length from center ; Add point to results . ; Return the N points ; Function to display the content of the vector A ; Iterate over A ; Print the N random points stored ; Driver Code ; Given dimensions ; Function Call
#include <bits/stdc++.h> NEW_LINE using namespace std ; #define PI  3.141592653589 NEW_LINE double uniform ( ) { return ( double ) rand ( ) / RAND_MAX ; } vector < pair < double , double > > randPoint ( int r , int x , int y , int n ) { vector < pair < double , double > > res ; for ( int i = 0 ; i < n ; i ++ ) { double theta = 2 * PI * uniform ( ) ; double len = sqrt ( uniform ( ) ) * r ; res . push_back ( { x + len * cos ( theta ) , y + len * sin ( theta ) } ) ; } return res ; } void printVector ( vector < pair < double , double > > A ) { for ( pair < double , double > P : A ) { printf ( " ( % . 2lf , ▁ % .2lf ) STRNEWLINE " , P . first , P . second ) ; } } int main ( ) { int R = 12 ; int X = 3 ; int Y = 3 ; int N = 5 ; printVector ( randPoint ( R , X , Y , N ) ) ; return 0 ; }
Check if an N | C ++ program for the above approach ; Function to check if the polygon exists or not ; Initialize a variable to store the sum of angles ; Loop through the array and calculate the sum of angles ; Check the condition for an N - side polygon ; Driver Code ; Given array arr [ ] ; Function Call
#include <iostream> NEW_LINE using namespace std ; void checkValidPolygon ( int arr [ ] , int N ) { int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { sum += arr [ i ] ; } if ( sum == 180 * ( N - 2 ) ) cout << " Yes " ; else cout << " No " ; } int main ( ) { int N = 3 ; int arr [ ] = { 60 , 60 , 60 } ; checkValidPolygon ( arr , N ) ; return 0 ; }
Find side of Square which makes minimal area to fit two identical rectangles inside it | C ++ program of the above approach ; if ' a ' and ' b ' same then double ' a ' or ' b ' and return ( 2 * a ) or ( 2 * b ) ; check if a != b ; if a > b ; double the smaller value that is ' b ' and store it to ' newB ' ; find the difference of ' newB ▁ and ▁ ' a ' ; if ' newB ' < a ; then add the difference of ' newB ' and ' a ' to the ' b ' to make ' b ' and ' a ' as same ; return side of the square a or b ; if ' newB ' > a then then add the difference of ' newB ' and ' a ' to the ' a ' to make ' a ' and ' newB ' as same ; return side of the square a or newB ; if a < b ; double the smaller value that is ' a ' and store it to ' newA ' ; find the difference of ' newA ▁ and ▁ ' b ' ; if ' newA ' < b ; then add the difference of ' newA ' and ' b ' to the ' a ' to make ' a ' and ' b ' as same ; return side of the square a or b ; if ' newA ' > b then then add the difference of ' newA ' and ' b ' to the ' b ' to make ' b ' and ' newA ' as same ; return side of the square b or newA ; Drive Code ; Size of rectangle
#include <bits/stdc++.h> NEW_LINE using namespace std ; int minimalSquareSide ( int a , int b ) { if ( a == b ) { return 2 * a ; } if ( a != b ) { if ( a > b ) { int newB = b + b ; int diff = abs ( newB - a ) ; if ( newB < a ) { b = newB + diff ; if ( a == b ) return a ; return 0 ; } else { a = a + diff ; if ( a == newB ) return a ; return 0 ; } } else { int newA = a + a ; int diff = abs ( newA - b ) ; if ( newA < b ) { a = diff + newA ; if ( a == b ) return a ; return 0 ; } else { b = b + diff ; if ( b == newA ) return b ; return 0 ; } } } } int main ( ) { int H , W ; H = 3 , W = 1 ; cout << minimalSquareSide ( H , W ) << endl ; return 0 ; }
Find the angle of Rotational Symmetry of an N | C ++ program to find the angle of Rotational Symmetry of an N - sided regular polygon ; function to find required minimum angle of rotation ; Store the answer in a double variable ; Calculating the angle of rotation and type - casting the integer N to double type ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; double minAnglRot ( int N ) { double res ; res = 360 / ( double ) N ; return res ; } int main ( ) { int N = 4 ; cout << " Angle ▁ of ▁ Rotational ▁ Symmetry : ▁ " << minAnglRot ( N ) ; return 0 ; }
Area of a Triangle from the given lengths of medians | C ++ 14 program to calculate area of a triangle from the given lengths of medians ; Function to return the area of triangle using medians ; Driver Code ; Function call ; Print the final answer
#include <bits/stdc++.h> NEW_LINE using namespace std ; double Area_of_Triangle ( int a , int b , int c ) { int s = ( a + b + c ) / 2 ; int x = s * ( s - a ) ; x = x * ( s - b ) ; x = x * ( s - c ) ; double area = ( 4 / ( double ) 3 ) * sqrt ( x ) ; return area ; } int main ( ) { int a = 9 ; int b = 12 ; int c = 15 ; double ans = Area_of_Triangle ( a , b , c ) ; cout << ans ; }
Total number of unit cells covered by all given Rectangles | C ++ program to find the number of cells enclosed by the given rectangles ; Update the coordinates lying within the rectangle ; Update arr [ i ] [ j ] for all ( i , j ) lying within the rectangle ; Function to return the total area covered by rectangles ; Stores the number of cells ; arr [ i ] ] [ [ j ] == 1 means that grid is filled by some rectangle ; Driver Code ; ( A [ i ] [ 0 ] , A [ i ] [ 1 ] ) denotes the coordinate of the bottom left of the rectangle ( A [ i ] [ 2 ] , A [ i ] [ 3 ] ) denotes the coordinate of upper right of the rectangle ; Update the coordinates that lie within the rectangle
#include <bits/stdc++.h> NEW_LINE using namespace std ; #define MAX  1001 NEW_LINE bool arr [ MAX ] [ MAX ] ; void updateArray ( int x1 , int y1 , int x2 , int y2 ) { for ( int i = x1 ; i < x2 ; i ++ ) { for ( int j = y1 ; j < y2 ; j ++ ) { arr [ i ] [ j ] = true ; } } } int findAreaCovered ( ) { int area = 0 ; for ( int i = 0 ; i < MAX ; i ++ ) { for ( int j = 0 ; j < MAX ; j ++ ) { if ( arr [ i ] [ j ] == true ) { area ++ ; } } } return area ; } int main ( ) { int N = 3 ; vector < vector < int > > A = { { 1 , 3 , 4 , 5 } , { 3 , 1 , 7 , 4 } , { 5 , 3 , 8 , 6 } } ; for ( int i = 0 ; i < N ; i ++ ) { updateArray ( A [ i ] [ 0 ] , A [ i ] [ 1 ] , A [ i ] [ 2 ] , A [ i ] [ 3 ] ) ; } int area = findAreaCovered ( ) ; cout << area ; return 0 ; }
Find the equation of plane which passes through two points and parallel to a given axis | C ++ implementation to find the equation of plane which passes through two points and parallel to a given axis ; Find direction vector of points ( x1 , y1 , z1 ) and ( x2 , y2 , z2 ) ; Values that are calculated and simplified from the cross product ; Print the equation of plane ; Driver Code ; Point A ; Point B ; Given axis ; Function Call
#include <bits/stdc++.h> NEW_LINE using namespace std ; void findEquation ( int x1 , int y1 , int z1 , int x2 , int y2 , int z2 , int d , int e , int f ) { double a = x2 - x1 ; double b = y2 - y1 ; double c = z2 - z1 ; int A = ( b * f - c * e ) ; int B = ( a * f - c * d ) ; int C = ( a * e - b * d ) ; int D = - ( A * d - B * e + C * f ) ; cout << A << " x ▁ + ▁ " << B << " y ▁ + ▁ " << C << " z ▁ + ▁ " << D << " = ▁ 0" ; } int main ( ) { int x1 = 2 , y1 = 3 , z1 = 5 ; int x2 = 6 , y2 = 7 , z2 = 8 ; int a = 11 , b = 23 , c = 10 ; findEquation ( x1 , y1 , z1 , x2 , y2 , z2 , a , b , c ) ; return 0 ; }
Find the length of the median of a Triangle if length of sides are given | C ++ program to find the length of the median using sides of the triangle ; Function to return the length of the median using sides of triangle ; Driver code ; Function call ; Print final answer with 2 digits after decimal
#include <bits/stdc++.h> NEW_LINE using namespace std ; float median ( int a , int b , int c ) { float n = sqrt ( 2 * b * b + 2 * c * c - a * a ) / 2 ; return n ; } int main ( ) { int a , b , c ; a = 4 ; b = 3 ; c = 5 ; float ans = median ( a , b , c ) ; cout << fixed << setprecision ( 2 ) << ans ; return 0 ; }
Number of quadrilateral formed with N distinct points on circumference of Circle | C ++ implementation to find the number of quadrilaterals formed with N distinct points ; Function to find the factorial of the given number N ; Loop to find the factorial of the given number ; Function to find the number of combinations in the N ; Driver Code ; Function Call
#include <bits/stdc++.h> NEW_LINE using namespace std ; int fact ( int n ) { int res = 1 ; for ( int i = 2 ; i < n + 1 ; i ++ ) res = res * i ; return res ; } int nCr ( int n , int r ) { return ( fact ( n ) / ( fact ( r ) * fact ( n - r ) ) ) ; } int main ( ) { int n = 5 ; cout << ( nCr ( n , 4 ) ) ; }
Length of remaining two sides of a Triangle from a given side and its adjacent angles | C ++ program for above approach ; Function for computing other 2 side of the trianlgle ; Computing angle C ; Converting A in to radian ; Converting B in to radian ; Converting C in to radian ; Computing length of side b ; Computing length of side c ; Driver code ; Calling function
#include <bits/stdc++.h> NEW_LINE using namespace std ; void findSide ( float a , float B , float C ) { float A = 180 - C - B ; float radA = M_PI * ( A / 180 ) ; float radB = M_PI * ( B / 180 ) ; float radC = M_PI * ( C / 180 ) ; float b = a / sin ( radA ) * sin ( radB ) ; float c = a / sin ( radA ) * sin ( radC ) ; cout << fixed << setprecision ( 15 ) << b << " ▁ " ; cout << fixed << setprecision ( 15 ) << c ; } int main ( ) { int a = 12 , B = 60 , C = 30 ; findSide ( a , B , C ) ; }
Minimum area of square holding two identical rectangles | C ++ program for the above problem ; Function to find the area of the square ; Larger side of rectangle ; Smaller side of the rectangle ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int areaSquare ( int L , int B ) { int large = max ( L , B ) ; int small = min ( L , B ) ; if ( large >= 2 * small ) return large * large ; else return ( 2 * small ) * ( 2 * small ) ; } int main ( ) { int L = 7 ; int B = 4 ; cout << areaSquare ( L , B ) ; return 0 ; }
Minimum side of square embedded in Regular polygon with N sides | C ++ program to find the minimum side of the square in which a regular polygon with even sides can completely embed ; PI value in C ++ using acos function ; Function to find the minimum side of the square in which a regular polygon with even sides can completely embed ; Projection angle variation from axes ; Projection angle variation when the number of sides are in multiple of 4 ; Distance between the end points ; Projection from all N points on X - axis ; Projection from all N points on Y - axis ; Maximum side ; Return the portion of side forming the square ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; const double pi = acos ( -1.0 ) ; double nGon ( int N ) { double proAngleVar ; if ( N % 4 == 0 ) { proAngleVar = pi * ( 180.0 / N ) / 180 ; } else { proAngleVar = pi * ( 180.0 / ( 2 * N ) ) / 180 ; } double negX = 1.0e+99 , posX = -1.0e+99 , negY = 1.0e+99 , posY = -1.0e+99 ; for ( int j = 0 ; j < N ; ++ j ) { double px = cos ( 2 * pi * j / N + proAngleVar ) ; double py = sin ( 2 * pi * j / N + proAngleVar ) ; negX = min ( negX , px ) ; posX = max ( posX , px ) ; negY = min ( negY , py ) ; posY = max ( posY , py ) ; } double opt2 = max ( posX - negX , posY - negY ) ; return ( double ) opt2 / sin ( pi / N ) / 2 ; } int main ( ) { int N = 10 ; cout << nGon ( N ) ; return 0 ; }
Heptacontagon Number | C ++ program for above approach ; Finding the nth heptacontagon number ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int heptacontagonNum ( int n ) { return ( 68 * n * n - 66 * n ) / 2 ; } int main ( ) { int N = 3 ; cout << "3rd ▁ heptacontagon ▁ Number ▁ is ▁ = ▁ " << heptacontagonNum ( N ) ; return 0 ; }
Program to check if N is a Icositetragonal number | C ++ implementation to check that a number is icositetragonal number or not ; Function to check that the number is a icositetragonal number ; Condition to check if the number is a icositetragonal number ; Driver Code ; Function call
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool isicositetragonal ( int N ) { float n = ( 10 + sqrt ( 44 * N + 100 ) ) / 22 ; return ( n - ( int ) n ) == 0 ; } int main ( ) { int i = 24 ; if ( isicositetragonal ( i ) ) { cout << " Yes " ; } else { cout << " No " ; } return 0 ; }
Program to check if N is a Tridecagonal Number or not | C ++ implementation to check that a number is a Tridecagon number or not ; Function to check that the number is a Tridecagon number ; Condition to check if the number is a Tridecagon number ; Driver Code ; Function call
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool isTridecagon ( int N ) { float n = ( 9 + sqrt ( 88 * N + 81 ) ) / 22 ; return ( n - ( int ) n ) == 0 ; } int main ( ) { int i = 13 ; if ( isTridecagon ( i ) ) { cout << " Yes " ; } else { cout << " No " ; } return 0 ; }
Program to check if N is a Icosihenagonal number | C ++ implementation to check that a number is icosihenagonal number or not ; Function to check that the number is a icosihenagonal number ; Condition to check if the number is a icosihenagonal number ; Driver Code ; Function call
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool isicosihenagonal ( int N ) { float n = ( 17 + sqrt ( 152 * N + 289 ) ) / 38 ; return ( n - ( int ) n ) == 0 ; } int main ( ) { int i = 21 ; if ( isicosihenagonal ( i ) ) { cout << " Yes " ; } else { cout << " No " ; } return 0 ; }
Program to check if N is a Icositrigonal number | C ++ implementation to check that a number is a icositrigonal number or not ; Function to check that the number is a icositrigonal number ; Condition to check if the number is a icositrigonal number ; Driver Code ; Function call
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool isicositrigonal ( int N ) { float n = ( 19 + sqrt ( 168 * N + 361 ) ) / 42 ; return ( n - ( int ) n ) == 0 ; } int main ( ) { int i = 23 ; if ( isicositrigonal ( i ) ) { cout << " Yes " ; } else { cout << " No " ; } return 0 ; }