Split given isosceles triangle of height H into N equal parts | C ++ Code for above approach ; Function to divide the isosceles triangle in equal parts by making N - 1 cuts parallel to the base ; Iterate over the range [ 1 , n - 1 ] ; Driver code ; Given N ; Given H ; Function call
#include <bits/stdc++.h> NEW_LINE using namespace std ; void findPoint ( int n , int h ) { for ( int i = 1 ; i < n ; i ++ ) printf ( " % .2f ▁ " , sqrt ( i / ( n * 1.0 ) ) * h ) ; } int main ( ) { int n = 3 ; int h = 2 ; findPoint ( n , h ) ; return 0 ; }