dhyuti-n/xlcost-variable-roles huggingface dataset:
Java program:
import java . util . * ; class GFG { public static float median ( int a , int b , int c ) { float n = ( float ) ( Math . sqrt ( 2 * b * b + 2 * c * c - a * a ) / 2 ) ; return n ; } public static void main ( String [ ] args ) { int a , b , c ; a = 4 ; b = 3 ; c = 5 ; float ans = median ( a , b , c ) ; System . out . println ( String . format ( " % .2f " , ans ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int nCr ( int n , int r ) { return ( fact ( n ) / ( fact ( r ) * fact ( n - r ) ) ) ; } static int fact ( int n ) { int res = 1 ; for ( int i = 2 ; i < n + 1 ; i ++ ) res = res * i ; return res ; } public static void main ( String [ ] args ) { int n = 5 ; System . out . println ( nCr ( n , 4 ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void findSide ( double a , double B , double C ) { double A = 180 - C - B ; double radA = ( Math . PI * ( A / 180 ) ) ; double radB = ( Math . PI * ( B / 180 ) ) ; double radC = ( Math . PI * ( C / 180 ) ) ; double b = ( a / Math . sin ( radA ) * Math . sin ( radB ) ) ; double c = ( a / Math . sin ( radA ) * Math . sin ( radC ) ) ; System . out . printf ( " % .15f " , b ) ; System . out . printf ( " ▁ % .15f " , c ) ; } public static void main ( String [ ] args ) { int a = 12 , B = 60 , C = 30 ; findSide ( a , B , C ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int areaSquare ( int L , int B ) { int large = Math . max ( L , B ) ; int small = Math . min ( L , B ) ; if ( large >= 2 * small ) { return large * large ; } else { return ( 2 * small ) * ( 2 * small ) ; } } public static void main ( String [ ] args ) { int L = 7 ; int B = 4 ; System . out . println ( areaSquare ( L , B ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static double pi = Math . acos ( - 1.0 ) ; static 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 = Math . cos ( 2 * pi * j / N + proAngleVar ) ; double py = Math . sin ( 2 * pi * j / N + proAngleVar ) ; negX = Math . min ( negX , px ) ; posX = Math . max ( posX , px ) ; negY = Math . min ( negY , py ) ; posY = Math . max ( posY , py ) ; } double opt2 = Math . max ( posX - negX , posY - negY ) ; return ( double ) opt2 / Math . sin ( pi / N ) / 2 ; } public static void main ( String [ ] args ) { int N = 10 ; System . out . printf ( " % .5f " , nGon ( N ) ) ; } }

Iterator variables: j
Class/struct names: GFG
Java program:
class GFG { static int heptacontagonNum ( int n ) { return ( 68 * n * n - 66 * n ) / 2 ; } public static void main ( String [ ] args ) { int N = 3 ; System . out . println ( "3rd ▁ heptacontagon ▁ Number ▁ is ▁ = ▁ " + heptacontagonNum ( N ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static boolean isicositetragonal ( int N ) { float n = ( float ) ( ( 10 + Math . sqrt ( 44 * N + 100 ) ) / 22 ) ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int i = 24 ; if ( isicositetragonal ( i ) ) { System . out . print ( " Yes " ) ; } else { System . out . print ( " No " ) ; } } }

Class/struct names: GFG
Java program:
class GFG { static boolean isTridecagon ( int N ) { float n = ( float ) ( ( 9 + Math . sqrt ( 88 * N + 81 ) ) / 22 ) ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int i = 13 ; if ( isTridecagon ( i ) ) { System . out . print ( " Yes " ) ; } else { System . out . print ( " No " ) ; } } }

Class/struct names: GFG
Java program:
class GFG { static boolean isicosihenagonal ( int N ) { float n = ( float ) ( ( 17 + Math . sqrt ( 152 * N + 289 ) ) / 38 ) ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int i = 21 ; if ( isicosihenagonal ( i ) ) { System . out . print ( " Yes " ) ; } else { System . out . print ( " No " ) ; } } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static boolean isicositrigonal ( int N ) { float n = ( float ) ( 19 + Math . sqrt ( 168 * N + 361 ) ) / 42 ; return ( n - ( int ) n ) == 0 ; } public static void main ( String args [ ] ) { int i = 23 ; if ( isicositrigonal ( i ) ) { System . out . print ( " Yes " ) ; } else { System . out . print ( " No " ) ; } } }

Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; class GFG { static long mod = 1000000007 ; static int MAXN = 1001 ; static long factorial [ ] = new long [ MAXN ] , inverse [ ] = new long [ MAXN ] ; static long power ( long a , long b ) { long res = 1 ; while ( b > 0 ) { if ( b % 2 == 1 ) { res = ( res * a ) % mod ; } a = ( a * a ) % mod ; b >>= 1 ; } return res ; } static long nCk ( int n , int k ) { if ( k < 0 k > n ) { return 0 ; } long ans = factorial [ n ] ; ans = ( ans * inverse [ n - k ] ) % mod ; ans = ( ans * inverse [ k ] ) % mod ; return ans ; } static void numberOfWays ( ArrayList < int [ ] > lines , int K , int N ) { Collections . sort ( lines , ( a , b ) -> a [ 0 ] - b [ 0 ] ) ; long total_case = nCk ( N , K ) ; PriorityQueue < Integer > m = new PriorityQueue < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { while ( ! m . isEmpty ( ) && ( m . peek ( ) < lines . get ( i ) [ 0 ] ) ) { m . poll ( ) ; } total_case -= nCk ( m . size ( ) , K - 1 ) ; total_case += mod ; total_case %= mod ; m . add ( lines . get ( i ) [ 1 ] ) ; } System . out . println ( total_case ) ; } static void preCompute ( ) { long fact = 1 ; factorial [ 0 ] = 1 ; inverse [ 0 ] = 1 ; for ( int i = 1 ; i < MAXN ; i ++ ) { fact = ( fact * i ) % mod ; factorial [ i ] = fact ; inverse [ i ] = power ( factorial [ i ] , mod - 2 ) ; } } public static void main ( String [ ] args ) { int N = 3 , K = 2 ; ArrayList < int [ ] > lines = new ArrayList < > ( ) ; preCompute ( ) ; lines . add ( new int [ ] { 1 , 3 } ) ; lines . add ( new int [ ] { 4 , 5 } ) ; lines . add ( new int [ ] { 5 , 7 } ) ; numberOfWays ( lines , K , N ) ; } }

Index/key variables: MAXN, i, k, n
Accumulator variables: i, total_case
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; import java . util . * ; class GFG { static void checkTriangle ( int x1 , int y1 , int x2 , int y2 , int x3 , int y3 ) { int a = x1 * ( y2 - y3 ) + x2 * ( y3 - y1 ) + x3 * ( y1 - y2 ) ; if ( a == 0 ) System . out . println ( " No " ) ; else System . out . println ( " Yes " ) ; } public static void main ( String [ ] args ) { int x1 = 1 , y1 = 1 , x2 = 2 , y2 = 2 , x3 = 3 , y3 = 3 ; checkTriangle ( x1 , y1 , x2 , y2 , x3 , y3 ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; @ SuppressWarnings ( " unchecked " ) class GFG { static class pair { public int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static int numTrip ( ArrayList points ) { int res = 0 ; for ( int i = 0 ; i < points . size ( ) ; ++ i ) { HashMap < Long , Integer > map = new HashMap < > ( ) ; for ( int j = 0 ; j < points . size ( ) ; ++ j ) { if ( j == i ) continue ; int dy = ( ( pair ) points . get ( i ) ) . second - ( ( pair ) points . get ( j ) ) . second ; int dx = ( ( pair ) points . get ( i ) ) . first - ( ( pair ) points . get ( j ) ) . first ; long key = dy * dy ; key += dx * dx ; if ( map . containsKey ( key ) ) { map . put ( key , map . get ( key ) + 1 ) ; } else { map . put ( key , 1 ) ; } } for ( int p : map . values ( ) ) res += p * ( p - 1 ) ; } return res ; } public static void main ( String [ ] args ) { ArrayList mat = new ArrayList ( ) ; mat . add ( new pair ( 0 , 0 ) ) ; mat . add ( new pair ( 1 , 0 ) ) ; mat . add ( new pair ( 2 , 0 ) ) ; System . out . println ( numTrip ( mat ) ) ; } }

Accumulator variables: key, res
Iterator variables: i, j, p
Class/struct names: GFG, pair
Java program:
class GFG { static boolean checkOverlap ( int R , int Xc , int Yc , int X1 , int Y1 , int X2 , int Y2 ) { int Xn = Math . max ( X1 , Math . min ( Xc , X2 ) ) ; int Yn = Math . max ( Y1 , Math . min ( Yc , Y2 ) ) ; int Dx = Xn - Xc ; int Dy = Yn - Yc ; return ( Dx * Dx + Dy * Dy ) <= R * R ; } public static void main ( String [ ] args ) { int R = 1 ; int Xc = 0 , Yc = 0 ; int X1 = 1 , Y1 = - 1 ; int X2 = 3 , Y2 = 1 ; if ( checkOverlap ( R , Xc , Yc , X1 , Y1 , X2 , Y2 ) ) { System . out . print ( " True " + "NEW_LINE"); } else { System . out . print ( " False " ) ; } } }

Class/struct names: GFG
Java program:
class GFG { static class pair { int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static int checkIntersection ( pair p1 , pair p2 , pair p ) { int val ; if ( p1 . second == p2 . second && p1 . second == p . second ) { if ( p . first <= Math . max ( p1 . first , p2 . first ) && ( p . first >= Math . min ( p1 . first , p2 . first ) ) ) return 1 ; } if ( p1 . first == p2 . first && p1 . first == p . first ) { if ( p . second <= Math . max ( p1 . second , p2 . second ) && ( p . second >= Math . min ( p1 . second , p2 . second ) ) ) return 1 ; } else { val = ( p . second - p1 . second ) * ( p2 . first - p1 . first ) - ( p . first - p1 . first ) * ( p2 . second - p1 . second ) ; if ( val == 0 ) if ( ( p . first <= Math . max ( p1 . first , p2 . first ) && ( p . first >= Math . min ( p1 . first , p2 . first ) ) ) && ( p . second <= Math . max ( p1 . second , p2 . second ) && ( p . second >= Math . min ( p1 . second , p2 . second ) ) ) ) return 1 ; } return 0 ; } static void towerOfSight ( pair a , pair b , pair c , pair d ) { int flag = 0 ; if ( checkIntersection ( a , c , b ) == 1 ) flag = 1 ; else if ( checkIntersection ( a , c , d ) == 1 ) flag = 1 ; else if ( checkIntersection ( b , d , a ) == 1 ) flag = 1 ; else if ( checkIntersection ( b , d , c ) == 1 ) flag = 1 ; System . out . print ( flag == 1 ? "Yes " : " No "); } public static void main ( String [ ] args ) { pair a = new pair ( 0 , 0 ) ; pair b = new pair ( 0 , - 2 ) ; pair c = new pair ( 2 , 0 ) ; pair d = new pair ( 0 , 2 ) ; towerOfSight ( a , b , c , d ) ; } }

Class/struct names: GFG, pair
Java program:
import java . util . * ; class GFG { static int NotParallel ( int p [ ] [ ] , int n ) { HashMap < Integer , Integer > x_axis = new HashMap < Integer , Integer > ( ) ; HashMap < Integer , Integer > y_axis = new HashMap < Integer , Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( x_axis . containsKey ( p [ i ] [ 0 ] ) ) x_axis . put ( p [ i ] [ 0 ] , x_axis . get ( p [ i ] [ 0 ] ) + 1 ) ; else x_axis . put ( p [ i ] [ 0 ] , 1 ) ; if ( y_axis . containsKey ( p [ i ] [ 1 ] ) ) y_axis . put ( p [ i ] [ 1 ] , y_axis . get ( p [ i ] [ 1 ] ) + 1 ) ; else y_axis . put ( p [ i ] [ 1 ] , 1 ) ; } int total = ( n * ( n - 1 ) ) / 2 ; for ( Map . Entry < Integer , Integer > i : x_axis . entrySet ( ) ) { int c = i . getValue ( ) ; total -= ( c * ( c - 1 ) ) / 2 ; } for ( Map . Entry < Integer , Integer > i : y_axis . entrySet ( ) ) { int c = i . getValue ( ) ; total -= ( c * ( c - 1 ) ) / 2 ; } return total ; } public static void main ( String [ ] args ) { int p [ ] [ ] = { { 1 , 2 } , { 1 , 5 } , { 1 , 15 } , { 2 , 10 } } ; int n = p . length ; System . out . print ( NotParallel ( p , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, total
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int check ( int n , int m ) { if ( m % n == 0 ) { System . out . print ( " YES " ) ; } else { System . out . print ( " NO " ) ; } return 0 ; } public static void main ( String [ ] args ) { int n = 5 ; int m = 10 ; check ( n , m ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void findModulo ( String s ) { int l = s . length ( ) ; int i , modulus = 0 ; if ( s . contains ( " + " ) ) { i = s . indexOf ( " + " ) ; } else { i = s . indexOf ( " - " ) ; } String real = s . substring ( 0 , i ) ; String imaginary = s . substring ( i + 1 , l - 1 ) ; int x = Integer . parseInt ( real ) ; int y = Integer . parseInt ( imaginary ) ; System . out . print ( Math . sqrt ( x * x + y * y ) + "NEW_LINE"); } public static void main ( String [ ] args ) { String s = "3 + 4i " ; findModulo ( s ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void disp ( int row_no , int block ) { System . out . print ( row_no * block ) ; } static int row ( int ht , int h ) { return ht / h ; } static void calculate ( int l , int w , int h , int a , int ht ) { int no_block = ( 4 * a ) / l ; int row_no ; if ( h < w ) row_no = row ( ht , w ) ; else row_no = row ( ht , h ) ; disp ( row_no , no_block ) ; } public static void main ( String [ ] args ) { int l = 50 , w = 20 , h = 35 ; int a = 700 ; int ht = 140 ; calculate ( l , w , h , a , ht ) ; } }

Class/struct names: GFG
Java program:
class GFG { static double solve ( int s ) { double area = ( 1.732 * Math . pow ( s , 2 ) ) / 8 ; return area ; } public static void main ( String [ ] args ) { int n = 14 ; System . out . println ( solve ( n ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static float find_Area ( float a ) { float R = a * ( float ) ( 2.0 - Math . sqrt ( 2 ) ) ; float area = ( float ) ( ( 3.14 * R * R ) / 2.0 ) ; return area ; } public static void main ( String [ ] args ) { float a = 4 ; System . out . println ( " ▁ Area ▁ of ▁ semicircle ▁ = ▁ " + find_Area ( a ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int times ( int [ ] steps , int n ) { int current_level = 0 ; int previous_level = 0 ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { previous_level = current_level ; current_level = current_level + steps [ i ] ; if ( ( previous_level < 0 && current_level >= 0 ) || ( previous_level > 0 && current_level <= 0 ) ) { count ++ ; } } return count ; } public static void main ( String [ ] args ) { int steps [ ] = { 1 , - 1 , 0 , 0 , 1 , 1 , - 3 , 2 } ; int n = steps . length ; System . out . println ( times ( steps , n ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class solution { static double [ ] XandYandZintercept ( double A , double B , double C , double D ) { double [ ] rslt = new double [ 3 ] ; double x = - D / A ; double y = - D / B ; double z = - D / C ; rslt [ 0 ] = x ; rslt [ 1 ] = y ; rslt [ 2 ] = z ; return rslt ; } static void equation_plane ( int [ ] p , int [ ] q , int [ ] r ) { int x1 = p [ 0 ] ; int y1 = p [ 1 ] ; int z1 = p [ 2 ] ; int x2 = q [ 0 ] ; int y2 = q [ 1 ] ; int z2 = q [ 2 ] ; int x3 = r [ 0 ] ; int y3 = r [ 1 ] ; int z3 = r [ 2 ] ; int a1 = x2 - x1 ; int b1 = y2 - y1 ; int c1 = z2 - z1 ; int a2 = x3 - x1 ; int b2 = y3 - y1 ; int c2 = z3 - z1 ; int A = b1 * c2 - b2 * c1 ; int B = a2 * c1 - a1 * c2 ; int C = a1 * b2 - b1 * a2 ; int D = ( - A * x1 - B * y1 - C * z1 ) ; double [ ] rslt = XandYandZintercept ( A , B , C , D ) ; for ( int i = 0 ; i < 3 ; i ++ ) { System . out . printf ( rslt [ i ] + " ▁ " ) ; } } public static void main ( String args [ ] ) { int x1 = - 1 ; int y1 = 2 ; int z1 = 1 ; int x2 = 0 ; int y2 = - 3 ; int z2 = 2 ; int x3 = 1 ; int y3 = 1 ; int z3 = - 4 ; int [ ] p = { x1 , y1 , z1 } ; int [ ] q = { x2 , y2 , z2 } ; int [ ] r = { x3 , y3 , z3 } ; equation_plane ( p , q , r ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: solution
Java program:
class GFG { static void new_vol ( double x ) { if ( x > 0 ) { System . out . print ( " % ▁ change ▁ in ▁ the ▁ " + " volume ▁ of ▁ the ▁ hemisphere : ▁ " + ( Math . pow ( x , 3 ) / 10000 + 3 * x + ( 3 * Math . pow ( x , 2 ) ) / 100 ) + " % " + " increaseNEW_LINE"); } else if ( x < 0 ) { System . out . print ( " % ▁ change ▁ in ▁ the ▁ " + " volume ▁ of ▁ the ▁ hemisphere : ▁ " + ( Math . pow ( x , 3 ) / 10000 + 3 * x + ( 3 * Math . pow ( x , 2 ) ) / 100 ) + "% decreaseNEW_LINE"); } else { System . out . print ( " Volume ▁ remains ▁ the ▁ same . " ) ; } } public static void main ( String [ ] args ) { double x = - 10.0 ; new_vol ( x ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static class pair { int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static Vector < pair > FindPoints ( int n ) { Vector < pair > v = new Vector < pair > ( ) ; v . add ( new pair ( 0 , 0 ) ) ; v . add ( new pair ( 0 , n ) ) ; v . add ( new pair ( n , 0 ) ) ; v . add ( new pair ( n , n ) ) ; if ( n % 2 == 0 ) v . add ( new pair ( n / 2 , n / 2 ) ) ; return v ; } public static void main ( String [ ] args ) { int N = 8 ; Vector < pair > v = FindPoints ( N ) ; for ( pair i : v ) { System . out . print ( " ( " + i . first + " , ▁ " + i . second + " ) ▁ " ) ; } } }

Iterator variables: i
Class/struct names: GFG, pair
Java program:
class GFG { static double pie = 3.1415926535897 ; static double findsolution ( double d , double h , double m , double n ) { double k = ( 4 * m ) / ( pie * d * d ) ; if ( n > k ) return - 1 ; double ans = ( h / ( k - n ) ) ; return ans ; } public static void main ( String [ ] args ) { double d = 1 , h = 1 , m = 1 , n = 1 ; System . out . printf ( " % .5f " , findsolution ( d , h , m , n ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int sumOfInternalAngles ( int n ) { if ( n < 3 ) return 0 ; return ( ( n - 2 ) * 180 ) ; } public static void main ( String args [ ] ) { int n = 5 ; System . out . print ( sumOfInternalAngles ( n ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int cntWays ( int n ) { if ( n % 2 == 1 ) { return 0 ; } else { return ( n - 2 ) / 4 ; } } public static void main ( String [ ] args ) { int n = 18 ; System . out . println ( cntWays ( n ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int noOfTriangles ( int n ) { int y = 4 * n ; return ( ( y * ( y - 2 ) * ( y - 1 ) ) - ( 4 * n * ( n - 2 ) * ( n - 1 ) ) ) / 6 ; } public static void main ( String [ ] args ) { int n = 1 ; System . out . println ( noOfTriangles ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int angle ( int n ) { return 2 * n ; } public static void main ( String [ ] args ) { int n = 30 ; System . out . println ( angle ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; import java . io . * ; class GFG { public static boolean orthogonality ( int x1 , int y1 , int x2 , int y2 , int r1 , int r2 ) { int dsquare = ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ) ; if ( dsquare == r1 * r1 + r2 * r2 ) return true ; else return false ; } public static void main ( String [ ] args ) throws java . lang . Exception { int x1 = 4 , y1 = 3 ; int x2 = 0 , y2 = 1 ; int r1 = 2 , r2 = 4 ; boolean f = orthogonality ( x1 , y1 , x2 , y2 , r1 , r2 ) ; if ( f ) System . out . println ( " Given ▁ circles ▁ are ▁ orthogonal . " ) ; else System . out . println ( " Given ▁ circles ▁ are ▁ not ▁ orthogonal . " ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int dx [ ] = { - 1 , 0 , 1 , 0 } ; static int dy [ ] = { 0 , 1 , 0 , - 1 } ; static boolean ifRight ( int x1 , int y1 , int x2 , int y2 , int x3 , int y3 ) { int a = ( ( x1 - x2 ) * ( x1 - x2 ) ) + ( ( y1 - y2 ) * ( y1 - y2 ) ) ; int b = ( ( x1 - x3 ) * ( x1 - x3 ) ) + ( ( y1 - y3 ) * ( y1 - y3 ) ) ; int c = ( ( x2 - x3 ) * ( x2 - x3 ) ) + ( ( y2 - y3 ) * ( y2 - y3 ) ) ; if ( ( a == ( b + c ) && a != 0 && b != 0 && c != 0 ) || ( b == ( a + c ) && a != 0 && b != 0 && c != 0 ) || ( c == ( a + b ) && a != 0 && b != 0 && c != 0 ) ) { return true ; } return false ; } static void isValidCombination ( int x1 , int y1 , int x2 , int y2 , int x3 , int y3 ) { int x , y ; boolean possible = false ; if ( ifRight ( x1 , y1 , x2 , y2 , x3 , y3 ) ) { System . out . print ( " ALREADY ▁ RIGHT ▁ ANGLED " ) ; return ; } else { for ( int i = 0 ; i < 4 ; i ++ ) { x = dx [ i ] + x1 ; y = dy [ i ] + y1 ; if ( ifRight ( x , y , x2 , y2 , x3 , y3 ) ) { System . out . print ( " POSSIBLE " ) ; return ; } x = dx [ i ] + x2 ; y = dy [ i ] + y2 ; if ( ifRight ( x1 , y1 , x , y , x3 , y3 ) ) { System . out . print ( " POSSIBLE " ) ; return ; } x = dx [ i ] + x3 ; y = dy [ i ] + y3 ; if ( ifRight ( x1 , y1 , x2 , y2 , x , y ) ) { System . out . print ( " POSSIBLE " ) ; return ; } } } if ( ! possible ) System . out . println ( " NOT ▁ POSSIBLE " ) ; } public static void main ( String [ ] args ) { int x1 = - 49 , y1 = 0 ; int x2 = 0 , y2 = 50 ; int x3 = 0 , y3 = - 50 ; isValidCombination ( x1 , y1 , x2 , y2 , x3 , y3 ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Boolean variables: possible
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static double area_of_regular_polygon ( double n , double len ) { double P = ( len * n ) ; double A = len / ( 2 * Math . tan ( ( 180 / n ) * 3.14159 / 180 ) ) ; double area = ( P * A ) / 2 ; return area ; } static double area_of_triangle_inscribed ( double n , double len ) { double area = area_of_regular_polygon ( n , len ) ; double triangle = area / n ; double ins_tri = ( triangle * 3 ) ; return ins_tri ; } static public void main ( String [ ] arg ) { double n = 6 , len = 10 ; System . out . printf ( " % .3f " , area_of_triangle_inscribed ( n , len ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static float Area ( int d , int h1 , int h2 ) { float area ; area = ( float ) 0.5 * d * ( h1 + h2 ) ; return area ; } public static void main ( String [ ] args ) { int d = 6 , h1 = 4 , h2 = 3 ; System . out . println ( " Area ▁ of ▁ Quadrilateral ▁ = ▁ " + Area ( d , h1 , h2 ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static float diagonal_length ( float a ) { float L ; L = a * ( float ) Math . sqrt ( 3 ) ; return L ; } public static void main ( String [ ] args ) { float a = 5 ; System . out . println ( diagonal_length ( a ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int concentric_Haxagon ( int n ) { return 3 * ( int ) Math . pow ( n , 2 ) / 2 ; } public static void main ( String [ ] args ) { int n = 3 ; System . out . println ( concentric_Haxagon ( n ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static double PI = 3.14 ; static double find_area ( int r , int d ) { double R = d / PI ; R += Math . pow ( r , 2 ) ; R = Math . sqrt ( R ) ; double area = PI * Math . pow ( R , 2 ) ; return area ; } public static void main ( String [ ] args ) { int r = 4 , d = 5 ; System . out . println ( find_area ( r , d ) ) ; } }

Accumulator variables: R
Class/struct names: GFG
Java program:
class GFG { public static int Valid ( int a , int b , int c , int d ) { if ( a + b + c + d == 360 ) return 1 ; return 0 ; } public static void main ( String [ ] args ) { int a = 80 , b = 70 , c = 100 , d = 110 ; if ( Valid ( a , b , c , d ) == 1 ) System . out . println ( " Valid ▁ quadrilateral " ) ; else System . out . println ( " Invalid ▁ quadrilateral " ) ; } }

Class/struct names: GFG
Java program:
class GFG { static double calculate_angle ( double n ) { double total_angle = 360 ; return total_angle / n ; } public static void main ( String [ ] args ) { double N = 5 ; System . out . println ( calculate_angle ( N ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static float angleOncirCumference ( float z ) { return ( z / 2 ) ; } public static void main ( String [ ] args ) { float angle = 65 ; float z = angleOncirCumference ( angle ) ; System . out . println ( " The ▁ angle ▁ is ▁ " + z + " ▁ degrees " ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void PrintMaxMinValue ( double a , double b , double c ) { double secondPart = c * 1.0 - ( b * b / ( 4.0 * a ) ) ; if ( a > 0 ) { System . out . print ( " Maxvalue ▁ = ▁ " + "InfinityNEW_LINE"); System . out . print ( " Minvalue ▁ = ▁ " + secondPart ) ; } else if ( a < 0 ) { System . out . print ( " Maxvalue ▁ = ▁ " + secondPart + "NEW_LINE"); System . out . print ( " Minvalue ▁ = ▁ " + " - Infinity " ) ; } else { System . out . print ( "Not a quadratic functionNEW_LINE"); } } public static void main ( String [ ] args ) { double a = - 1 , b = 3 , c = - 2 ; PrintMaxMinValue ( a , b , c ) ; } }

Class/struct names: GFG