dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; public class Node { public char data ; public Node left , right ; public Node ( char item ) { data = item ; left = right = null ; } } public class Index { public int index ; } class GFG { public Node root ; public Index index_obj = new Index ( ) ; public virtual void storeAlternate ( Node node , char [ ] arr , Index index , int l ) { if ( node == null ) { return ; } storeAlternate ( node . left , arr , index , l + 1 ) ; if ( l % 2 != 0 ) { arr [ index . index ] = node . data ; index . index ++ ; } storeAlternate ( node . right , arr , index , l + 1 ) ; } public virtual void modifyTree ( Node node , char [ ] arr , Index index , int l ) { if ( node == null ) { return ; } modifyTree ( node . left , arr , index , l + 1 ) ; if ( l % 2 != 0 ) { node . data = arr [ index . index ] ; ( index . index ) ++ ; } modifyTree ( node . right , arr , index , l + 1 ) ; } public virtual void reverse ( char [ ] arr , int n ) { int l = 0 , r = n - 1 ; while ( l < r ) { char temp = arr [ l ] ; arr [ l ] = arr [ r ] ; arr [ r ] = temp ; l ++ ; r -- ; } } public virtual void reverseAlternate ( ) { reverseAlternate ( root ) ; } public virtual void reverseAlternate ( Node node ) { char [ ] arr = new char [ 100 ] ; storeAlternate ( node , arr , index_obj , 0 ) ; reverse ( arr , index_obj . index ) ; index_obj . index = 0 ; modifyTree ( node , arr , index_obj , 0 ) ; } public virtual void printInorder ( ) { printInorder ( root ) ; } public virtual void printInorder ( Node node ) { if ( node == null ) { return ; } printInorder ( node . left ) ; Console . Write ( node . data + " ▁ " ) ; printInorder ( node . right ) ; } public static void Main ( string [ ] args ) { GFG tree = new GFG ( ) ; tree . root = new Node ( ' a ' ) ; tree . root . left = new Node ( ' b ' ) ; tree . root . right = new Node ( ' c ' ) ; tree . root . left . left = new Node ( ' d ' ) ; tree . root . left . right = new Node ( ' e ' ) ; tree . root . right . left = new Node ( ' f ' ) ; tree . root . right . right = new Node ( ' g ' ) ; tree . root . left . left . left = new Node ( ' h ' ) ; tree . root . left . left . right = new Node ( ' i ' ) ; tree . root . left . right . left = new Node ( ' j ' ) ; tree . root . left . right . right = new Node ( ' k ' ) ; tree . root . right . left . left = new Node ( ' l ' ) ; tree . root . right . left . right = new Node ( ' m ' ) ; tree . root . right . right . left = new Node ( ' n ' ) ; tree . root . right . right . right = new Node ( ' o ' ) ; Console . WriteLine ( " Inorder ▁ Traversal ▁ of ▁ given ▁ tree " ) ; tree . printInorder ( ) ; tree . reverseAlternate ( ) ; Console . WriteLine ( " " ) ; Console . WriteLine ( " " ) ; Console . WriteLine ( " Inorder ▁ Traversal ▁ of ▁ modified ▁ tree " ) ; tree . printInorder ( ) ; } }

Index/key variables: l, r
Accumulator variables: index, l, r
Class/struct names: GFG, Index, Node
C# program:
using System ; using System . Collections . Generic ; public class GFG { static double line_slope ( double a , double b ) { if ( a != 0 ) return - b / a ; else return ( - 2 ) ; } static void line_equation ( double a , double b , double c , double x1 , double y1 , double alfa ) { double given_slope = line_slope ( a , b ) ; double x = alfa * 3.14159 / 180 ; double slope_1 , slope_2 ; double g , f ; if ( given_slope == - 2 ) { slope_1 = Math . Tan ( x ) ; slope_2 = Math . Tan ( 3.14159 - x ) ; g = ( int ) x1 ; f = ( int ) x1 ; g *= ( - slope_1 ) ; g += y1 ; if ( g > 0 ) Console . WriteLine ( " y ▁ = ▁ " + ( Math . Round ( slope_1 * 100.0 ) / 100.0 ) + " x ▁ + " + ( Math . Round ( ( int ) g * 100.0 ) / 100.0 ) ) ; if ( g <= 0 ) Console . WriteLine ( " y ▁ = ▁ " + ( Math . Round ( slope_1 * 100.0 ) / 100.0 ) + " x ▁ " + ( Math . Round ( ( int ) g * 100.0 ) / 100.0 ) ) ; f *= ( - slope_2 ) ; f += y1 ; if ( f > 0 ) { Console . WriteLine ( " y ▁ = ▁ " + ( Math . Round ( slope_2 * 100.0 ) / 100.0 ) + " x ▁ + " + ( Math . Round ( ( int ) f * 100.0 ) / 100.0 ) ) ; } if ( f <= 0 ) Console . WriteLine ( " y ▁ = ▁ " + ( Math . Round ( slope_1 * 100.0 ) / 100.0 ) + " x ▁ " + ( Math . Round ( ( int ) g * 100.0 ) / 100.0 ) ) ; return ; } if ( 1 - Math . Tan ( x ) * given_slope == 0 ) { Console . WriteLine ( " x ▁ = ▁ " + ( Math . Round ( x1 * 100.0 ) / 100.0 ) ) ; } if ( 1 + Math . Tan ( x ) * given_slope == 0 ) { Console . WriteLine ( " x ▁ = ▁ " + ( Math . Round ( x1 * 100.0 ) / 100.0 ) ) ; } slope_1 = ( given_slope + Math . Tan ( x ) ) / ( 1 - Math . Tan ( x ) * given_slope ) ; slope_2 = ( given_slope - Math . Tan ( x ) ) / ( 1 + Math . Tan ( x ) * given_slope ) ; g = ( int ) x1 ; f = ( int ) x1 ; g *= ( - slope_1 ) ; g += y1 ; if ( g > 0 && 1 - Math . Tan ( x ) * given_slope != 0 ) Console . WriteLine ( " y ▁ = ▁ " + ( Math . Round ( slope_1 * 100.0 ) / 100.0 ) + " x ▁ + " + ( Math . Round ( ( int ) g * 100.0 ) / 100.0 ) ) ; if ( g <= 0 && 1 - Math . Tan ( x ) * given_slope != 0 ) Console . WriteLine ( " y ▁ = ▁ " + ( Math . Round ( slope_1 * 100.0 ) / 100.0 ) + " x ▁ " + ( Math . Round ( ( int ) g * 100.0 ) / 100.0 ) ) ; f *= ( - slope_2 ) ; f += y1 ; if ( f > 0 && 1 + Math . Tan ( x ) * given_slope != 0 ) { Console . WriteLine ( " y ▁ = ▁ " + ( Math . Round ( slope_2 * 100.0 ) / 100.0 ) + " x ▁ + " + ( Math . Round ( ( int ) f * 100.0 ) / 100.0 ) ) ; } if ( f <= 0 && 1 + Math . Tan ( x ) * given_slope != 0 ) Console . WriteLine ( " y ▁ = ▁ " + ( Math . Round ( slope_2 * 100.0 ) / 100.0 ) + " x ▁ + " + ( Math . Round ( ( int ) f * 100.0 ) / 100.0 ) ) ; } public static void Main ( String [ ] args ) { double a = 2 , b = 3 , c = - 7 ; double x1 = 4 , y1 = 9 ; double alfa = 30 ; line_equation ( a , b , c , x1 , y1 , alfa ) ; } }

Accumulator variables: f, g
Class/struct names: GFG
C# program:
using System ; class GFG { static double normal_slope ( double a , double b , double x1 , double y1 ) { double g = a / 2 ; double f = b / 2 ; if ( g - x1 == 0 ) return ( - 1 ) ; double slope = ( f - y1 ) / ( g - x1 ) ; if ( slope == 0 ) return ( - 2 ) ; return slope ; } static void normal_equation ( double a , double b , double x1 , double y1 ) { double slope = normal_slope ( a , b , x1 , y1 ) ; if ( slope == - 1 ) { Console . WriteLine ( " x ▁ = ▁ " + x1 ) ; } if ( slope == - 2 ) { Console . WriteLine ( " y ▁ = ▁ " + y1 ) ; } if ( slope != - 1 && slope != - 2 ) { x1 *= - slope ; x1 += y1 ; if ( x1 > 0 ) Console . WriteLine ( " y ▁ = ▁ " + slope + " x ▁ + " + Math . Round ( x1 , 2 ) ) ; else Console . WriteLine ( " y ▁ = ▁ " + slope + " x ▁ " + Math . Round ( x1 , 2 ) ) ; } } public static void Main ( String [ ] args ) { int a = 4 , b = 6 ; int x1 = 12 , y1 = 14 ; normal_equation ( a , b , x1 , y1 ) ; } }

Accumulator variables: x1
Class/struct names: GFG
C# program:
using System ; class GFG { static void findSquareSum ( int [ , ] Coordinates , int N ) { long xq = 0 , yq = 0 ; long xs = 0 , ys = 0 ; long res = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int a , b ; a = Coordinates [ i , 0 ] ; b = Coordinates [ i , 1 ] ; res += xq ; res -= 2 * xs * a ; res += i * ( long ) ( a * a ) ; xq += a * a ; xs += a ; res += yq ; res -= 2 * ys * b ; res += i * ( long ) b * b ; yq += b * b ; ys += b ; } Console . Write ( res ) ; } static void Main ( ) { int [ , ] arr = { { 1 , 1 } , { - 1 , - 1 } , { 1 , - 1 } , { - 1 , 1 } } ; int N = arr . GetLength ( 0 ) ; findSquareSum ( arr , N ) ; } }

Accumulator variables: i, res, xq, xs, yq, ys
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class Gfg { public static int getPointsIns ( int x1 , int y1 , int radius , int x2 , int y2 , pair [ ] points ) { int ans = 0 ; for ( int i = 0 ; i < points . Length ; i ++ ) { bool condOne = false , condTwo = false ; if ( ( points [ i ] . b - y2 ) * ( x2 - x1 ) - ( y2 - y1 ) * ( points [ i ] . a - x2 ) >= 0 ) { condOne = true ; } if ( radius >= ( int ) Math . Sqrt ( Math . Pow ( ( y1 - points [ i ] . b ) , 2 ) + Math . Pow ( x1 - points [ i ] . a , 2 ) ) ) { condTwo = true ; } if ( condOne && condTwo ) { ans += 1 ; } } return ans ; } public static void Main ( string [ ] args ) { int X = 0 ; int Y = 0 ; int R = 5 ; int P = 5 ; int Q = 0 ; pair [ ] arr = { new pair ( 2 , 3 ) , new pair ( 5 , 6 ) , new pair ( - 1 , 4 ) , new pair ( 5 , 5 ) } ; Console . Write ( getPointsIns ( X , Y , R , P , Q , arr ) ) ; } } public class pair { public int a ; public int b ; public pair ( int a , int b ) { this . a = a ; this . b = b ; } }

Index/key variables: i
Accumulator variables: ans, i
Iterator variables: i
Boolean variables: condOne, condTwo
Class/struct names: Gfg, pair
C# program:
using System ; class GFG { static void cntPairs ( int [ , ] points , int n , int K ) { int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { int dist = 0 ; for ( int k = 0 ; k < K ; k ++ ) { int temp = ( points [ i , k ] - points [ j , k ] ) ; dist += temp * temp ; } if ( Math . Sqrt ( dist ) * Math . Sqrt ( dist ) == dist ) { ans += 1 ; } } } Console . WriteLine ( ans ) ; } public static void Main ( ) { int K = 2 ; int [ , ] points = { { 1 , 2 } , { 5 , 5 } , { - 2 , 8 } } ; int n = points . GetLength ( 0 ) ; cntPairs ( points , n , K ) ; } }

Accumulator variables: ans, dist, i, j, k
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static double Circumradius ( int a , int b , int c , int d ) { double s = ( a + b + c + d ) / 2.0 ; double radius = Math . Sqrt ( ( ( a * b ) + ( c * d ) ) * ( ( a * c ) + ( b * d ) ) * ( ( a * d ) + ( b * c ) ) / ( ( s - a ) * ( s - b ) * ( s - c ) * ( s - d ) ) ) ; return radius / 4 ; } public static void Main ( String [ ] args ) { int A = 3 ; int B = 4 ; int C = 5 ; int D = 6 ; double ans = Circumradius ( A , B , C , D ) ; Console . Write ( " { 0 : F2 } " , ans ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float Area_of_Triangle ( int a , int b , int k ) { float area = ( float ) ( ( 1 / 2.0 ) * a * b * Math . Sin ( k ) ) ; return area ; } public static void Main ( String [ ] args ) { int a = 9 ; int b = 12 ; int k = 2 ; float ans = Area_of_Triangle ( a , b , k ) ; Console . Write ( " { 0 : F1 } " , ans ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { class point { public double x , y ; public point ( ) { } public point ( double x , double y ) { this . x = x ; this . y = y ; } } ; static void lineFromPoints ( point P , point Q , double a , double b , double c ) { a = Q . y - P . y ; b = P . x - Q . x ; c = a * ( P . x ) + b * ( P . y ) ; } static void perpenBisectorFromLine ( point P , point Q , double a , double b , double c ) { point mid_point = new point ( ) ; mid_point . x = ( P . x + Q . x ) / 2 ; mid_point . y = ( P . y + Q . y ) / 2 ; c = - b * ( mid_point . x ) + a * ( mid_point . y ) ; double temp = a ; a = - b ; b = temp ; } static double LineInterX ( double a1 , double b1 , double c1 , double a2 , double b2 , double c2 ) { double determ = a1 * b2 - a2 * b1 ; double x = ( b2 * c1 - b1 * c2 ) ; x /= determ ; return x ; } static double LineInterY ( double a1 , double b1 , double c1 , double a2 , double b2 , double c2 ) { double determ = a1 * b2 - a2 * b1 ; double y = ( a1 * c2 - a2 * c1 ) ; y /= determ ; return y ; } static void findPosition ( point P , point Q , point R , point D ) { point r = new point ( ) ; double a = 0 , b = 0 , c = 0 ; lineFromPoints ( P , Q , a , b , c ) ; double e = 0 , f = 0 , g = 0 ; lineFromPoints ( Q , R , e , f , g ) ; perpenBisectorFromLine ( P , Q , a , b , c ) ; perpenBisectorFromLine ( Q , R , e , f , g ) ; r . x = LineInterX ( a , b , c , e , f , g ) ; r . y = LineInterY ( a , b , c , e , f , g ) ; double q = ( r . x - P . x ) * ( r . x - P . x ) + ( r . y - P . y ) * ( r . y - P . y ) ; double dis = ( r . x - D . x ) * ( r . x - D . x ) + ( r . y - D . y ) * ( r . y - D . y ) ; if ( dis < q ) { Console . Write ( " Point ▁ ( " + D . x + " , ▁ " + D . y + " ) ▁ is ▁ inside ▁ " + " the ▁ circumcircle " ) ; } else if ( dis == q ) { Console . Write ( " Point ▁ ( " + D . x + " , ▁ " + D . y + " ) ▁ lies ▁ on ▁ the ▁ " + " circumcircle " ) ; } else { Console . Write ( " Point ▁ ( " + D . x + " , ▁ " + D . y + " ) ▁ lies ▁ outside " + " ▁ the ▁ circumcircle " ) ; } } public static void Main ( String [ ] args ) { point A , B , C , D ; A = new point ( 2 , 8 ) ; B = new point ( 2 , 1 ) ; C = new point ( 4 , 5 ) ; D = new point ( 3 , 0 ) ; findPosition ( A , B , C , D ) ; } }

Accumulator variables: x, y
Class/struct names: GFG, point
C# program:
using System ; class GFG { static float find_angle ( int x , int y , int z ) { int volume = x * x * y ; float ans = 0 ; if ( z < volume / 2 ) { float d = ( float ) ( ( x * y * y ) / ( 2.0 * z ) ) ; ans = ( float ) Math . Atan ( d ) ; } else { z = volume - z ; float d = ( 2 * z ) / ( float ) ( x * x * x ) ; ans = ( float ) Math . Atan ( d ) ; } ans = ( float ) ( ( ans * 180 ) / 3.14159265 ) ; return ans ; } public static void Main ( String [ ] args ) { int x = 12 ; int y = 21 ; int z = 10 ; Console . Write ( find_angle ( x , y , z ) + " STRNEWLINE " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int countOdd ( int n ) { int coun = 0 , m , j , i ; for ( i = n - 2 ; i >= 1 ; i -- ) { if ( i >= 1 ) { m = ( n - i ) / 2 ; j = ( i * ( i + 1 ) ) / 2 ; coun += j * m ; } else { m = ( ( n - 1 ) - i ) / 2 ; j = ( i * ( i + 1 ) ) / 2 ; coun += j * m ; } } return coun ; } static int countEven ( int n ) { int coun = 0 , m , j , i ; for ( i = n - 2 ; i >= 1 ; i -- ) { if ( i >= 1 ) { m = ( ( n - 1 ) - i ) / 2 ; j = ( i * ( i + 1 ) ) / 2 ; coun += j * m ; } else { m = ( n - i ) / 2 ; j = ( i * ( i + 1 ) ) / 2 ; coun += j * m ; } } return coun ; } static public void Main ( ) { int n = 5 ; if ( n >= 1 ) Console . Write ( countOdd ( n ) ) ; else Console . Write ( countEven ( n ) ) ; } }

Accumulator variables: coun, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static float ellipse ( float l , float b ) { if ( l < 0 b < 0 ) return - 1 ; float x = ( float ) ( 3.14 * l * b ) / 4 ; return x ; } public static void Main ( ) { float a = 5 , b = 3 ; Console . WriteLine ( ellipse ( a , b ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void noOfSquares ( int x1 , int y1 , int x2 , int y2 ) { int dx = Math . Abs ( x2 - x1 ) ; int dy = Math . Abs ( y2 - y1 ) ; int ans = dx + dy - __gcd ( dx , dy ) ; Console . WriteLine ( ans ) ; } static int __gcd ( int a , int b ) { if ( b == 0 ) return a ; return __gcd ( b , a % b ) ; } static void Main ( ) { int x1 = 1 , y1 = 1 , x2 = 4 , y2 = 3 ; noOfSquares ( x1 , y1 , x2 , y2 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static long binomialCoeff ( int n , int k ) { long res = 1 ; if ( k > n - k ) k = n - k ; for ( int i = 0 ; i < k ; ++ i ) { res *= ( n - i ) ; res /= ( i + 1 ) ; } return res ; } static long countPaths ( int x1 , int y1 , int x2 , int y2 ) { int m = Math . Abs ( x1 - x2 ) ; int n = Math . Abs ( y1 - y2 ) ; return ( binomialCoeff ( m + n , n ) ) ; } public static void Main ( ) { int x1 = 2 , y1 = 3 , x2 = 4 , y2 = 5 ; Console . Write ( countPaths ( x1 , y1 , x2 , y2 ) ) ; } }

Accumulator variables: res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static double areaCircle ( double b ) { double area = ( double ) 3.1415926 * b * b ; return area ; } public static void Main ( ) { float b = 8 ; Console . WriteLine ( areaCircle ( b ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void section ( double x1 , double x2 , double y1 , double y2 , double z1 , double z2 , double m , double n ) { double x = ( ( m * x2 ) + ( n * x1 ) ) / ( m + n ) ; double y = ( ( m * y2 ) + ( n * y1 ) ) / ( m + n ) ; double z = ( ( m * z2 ) + ( n * z1 ) ) / ( m + n ) ; Console . Write ( " ( " + x + " , ▁ " ) ; Console . Write ( y + " , ▁ " ) ; Console . WriteLine ( z + " ) " ) ; } static public void Main ( ) { double x1 = 2 , x2 = 4 , y1 = - 1 , y2 = 3 , z1 = 4 , z2 = 2 , m = 2 , n = 3 ; section ( x1 , x2 , y1 , y2 , z1 , z2 , m , n ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float findRadiusOfcircumcircle ( float n , float a ) { if ( n < 0 a < 0 ) return - 1 ; float radius = ( float ) ( a / Math . Sqrt ( 2 - ( 2 * Math . Cos ( 360 / n ) ) ) ) ; return radius ; } public static void Main ( ) { float n = 5 , a = 6 ; Console . WriteLine ( findRadiusOfcircumcircle ( n , a ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static float findRadiusOfIncircle ( float a , float b , float c ) { if ( a < 0 b < 0 c < 0 ) return - 1 ; float p = ( a + b + c ) / 2 ; float area = ( float ) Math . Sqrt ( p * ( p - a ) * ( p - b ) * ( p - c ) ) ; float radius = area / p ; return ( float ) ( radius ) ; } public static void Main ( ) { float a = 2 , b = 2 , c = 3 ; Console . WriteLine ( findRadiusOfIncircle ( a , b , c ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float area ( int x1 , int y1 , int z1 , int x2 , int y2 , int z2 ) { double a = Math . Pow ( ( y1 * z2 - y2 * z1 ) , 2 ) + Math . Pow ( ( x1 * z2 - x2 * z1 ) , 2 ) + Math . Pow ( ( x1 * y2 - x2 * y1 ) , 2 ) ; float area = ( float ) Math . Sqrt ( a ) ; area = area / 2 ; return area ; } public static void Main ( ) { int x1 = - 2 ; int y1 = 0 ; int z1 = - 5 ; int x2 = 1 ; int y2 = - 2 ; int z2 = - 1 ; float a = area ( x1 , y1 , z1 , x2 , y2 , z2 ) ; Console . WriteLine ( " Area ▁ = ▁ " + a ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float trapezoidarea ( float r ) { if ( r < 0 ) return - 1 ; float a = ( 3 * ( float ) Math . Sqrt ( 3 ) * ( float ) Math . Pow ( r , 2 ) ) / 4 ; return a ; } public static void Main ( ) { float r = 5 ; Console . WriteLine ( " " + trapezoidarea ( r ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float rectanglearea ( float r ) { if ( r < 0 ) return - 1 ; float a = r * r ; return a ; } public static void Main ( ) { float r = 5 ; Console . Write ( ( int ) rectanglearea ( r ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int maxLines ( int n , int [ ] x1 , int [ ] y1 , int [ ] x2 , int [ ] y2 ) { HashSet < Double > s = new HashSet < Double > ( ) ; double slope ; for ( int i = 0 ; i < n ; ++ i ) { if ( x1 [ i ] == x2 [ i ] ) slope = int . MaxValue ; else slope = ( y2 [ i ] - y1 [ i ] ) * 1.0 / ( x2 [ i ] - x1 [ i ] ) * 1.0 ; s . Add ( slope ) ; } return s . Count ; } public static void Main ( ) { int n = 2 ; int [ ] x1 = { 1 , 2 } ; int [ ] y1 = { 1 , 2 } ; int [ ] x2 = { 2 , 4 } ; int [ ] y2 = { 2 , 10 } ; Console . Write ( maxLines ( n , x1 , y1 , x2 , y2 ) ) ; } }

Index/key variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static float area ( float x1 , float y1 , float z1 , float x2 , float y2 , float z2 ) { float area = ( float ) Math . Sqrt ( Math . Pow ( ( y1 * z2 - y2 * z1 ) , 2 ) + Math . Pow ( ( x1 * z2 - x2 * z1 ) , 2 ) + Math . Pow ( ( x1 * y2 - x2 * y1 ) , 2 ) ) ; return area ; } public static void Main ( ) { float x1 = 3 ; float y1 = 1 ; float z1 = - 2 ; float x2 = 1 ; float y2 = - 3 ; float z2 = 4 ; float a = area ( x1 , y1 , z1 , x2 , y2 , z2 ) ; Console . Write ( " Area ▁ = ▁ " + a ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int max_intersection ( int [ ] center , int length , int k ) { Array . Sort ( center ) ; if ( center [ 2 ] - center [ 0 ] >= 2 * k + length ) { return 0 ; } else if ( center [ 2 ] - center [ 0 ] >= 2 * k ) { return ( 2 * k - ( center [ 2 ] - center [ 0 ] - length ) ) ; } else return length ; } public static void Main ( ) { int [ ] center = { 1 , 2 , 3 } ; int L = 1 ; int K = 1 ; Console . WriteLine ( max_intersection ( center , L , K ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double haversine ( double lat1 , double lon1 , double lat2 , double lon2 ) { double dLat = ( Math . PI / 180 ) * ( lat2 - lat1 ) ; double dLon = ( Math . PI / 180 ) * ( lon2 - lon1 ) ; lat1 = ( Math . PI / 180 ) * ( lat1 ) ; lat2 = ( Math . PI / 180 ) * ( lat2 ) ; double a = Math . Pow ( Math . Sin ( dLat / 2 ) , 2 ) + Math . Pow ( Math . Sin ( dLon / 2 ) , 2 ) * Math . Cos ( lat1 ) * Math . Cos ( lat2 ) ; double rad = 6371 ; double c = 2 * Math . Asin ( Math . Sqrt ( a ) ) ; return rad * c ; } public static void Main ( ) { double lat1 = 51.5007 ; double lon1 = 0.1246 ; double lat2 = 40.6892 ; double lon2 = 74.0445 ; Console . WriteLine ( haversine ( lat1 , lon1 , lat2 , lon2 ) + " ▁ K . M . " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int pentatopeNum ( int n ) { return ( n * ( n + 1 ) * ( n + 2 ) * ( n + 3 ) ) / 24 ; } static public void Main ( String [ ] args ) { int n = 5 ; Console . WriteLine ( pentatopeNum ( n ) ) ; n = 11 ; Console . WriteLine ( pentatopeNum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int heptagonalNumber ( int n ) { return ( ( 5 * n * n ) - ( 3 * n ) ) / 2 ; } public static void Main ( ) { int n = 2 ; Console . WriteLine ( heptagonalNumber ( n ) ) ; n = 15 ; Console . WriteLine ( heptagonalNumber ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int icosidigonal_num ( int n ) { return ( 20 * n * n - 18 * n ) / 2 ; } static public void Main ( ) { int n = 4 ; Console . Write ( n + " th ▁ Icosidigonal ▁ " + " number ▁ : " ) ; Console . WriteLine ( icosidigonal_num ( n ) ) ; n = 8 ; Console . Write ( n + " th ▁ Icosidigonal ▁ " + " number ▁ : " ) ; Console . WriteLine ( icosidigonal_num ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GfG { static int power ( int n ) { if ( n == 1 ) return 2 ; return 2 * power ( n - 1 ) ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( power ( n ) ) ; } }

Class/struct names: GfG
C# program:
using System ; public class GFG { static void findPoint ( int x1 , int y1 , int x2 , int y2 ) { Console . WriteLine ( " ( " + ( int ) ( 2 * x2 - x1 ) + " , " + ( int ) ( 2 * y2 - y1 ) + " ▁ ) " ) ; } static public void Main ( String [ ] args ) { int x1 = 0 , y1 = 0 , x2 = 1 , y2 = 1 ; findPoint ( x1 , y1 , x2 , y2 ) ; } }

Class/struct names: GFG
C# program:
class GFG { static void parallel ( int [ , ] a ) { bool x = true , y = true ; for ( int i = 0 ; i < a . Rank - 1 ; i ++ ) { if ( a [ i , 0 ] != a [ i + 1 , 0 ] ) x = false ; if ( a [ i , 1 ] != a [ i + 1 , 1 ] ) y = false ; } if ( x ) System . Console . WriteLine ( " Parallel ▁ to ▁ Y ▁ Axis " ) ; else if ( y ) System . Console . WriteLine ( " Parallel ▁ to ▁ X ▁ Axis " ) ; else System . Console . WriteLine ( " Not ▁ parallel ▁ to ▁ X " + " ▁ and ▁ Y ▁ axis " ) ; } public static void Main ( ) { int [ , ] a = { { 1 , 2 } , { 1 , 4 } , { 1 , 6 } , { 1 , 0 } } ; parallel ( a ) ; } }

Accumulator variables: i
Iterator variables: i
Boolean variables: x, y
Class/struct names: GFG
C# program:
using System ; class GFG { static int numberOfSticks ( int x ) { return ( 3 * x * ( x + 1 ) ) / 2 ; } public static void Main ( ) { Console . Write ( numberOfSticks ( 7 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public class Point { public int x , y ; public Point ( int x , int y ) { this . x = x ; this . y = y ; } } ; static int overlappingArea ( Point l1 , Point r1 , Point l2 , Point r2 ) { int area1 = Math . Abs ( l1 . x - r1 . x ) * Math . Abs ( l1 . y - r1 . y ) ; int area2 = Math . Abs ( l2 . x - r2 . x ) * Math . Abs ( l2 . y - r2 . y ) ; int x_dist = ( Math . Min ( r1 . x , r2 . x ) - Math . Max ( l1 . x , l2 . x ) ) ; int y_dist = ( Math . Min ( r1 . y , r2 . y ) - Math . Max ( l1 . y , l2 . y ) ) ; int areaI = 0 ; if ( x_dist > 0 && y_dist > 0 ) { areaI = x_dist * y_dist ; } return ( area1 + area2 - areaI ) ; } public static void Main ( String [ ] args ) { Point l1 = new Point ( 2 , 2 ) , r1 = new Point ( 5 , 7 ) ; Point l2 = new Point ( 3 , 4 ) , r2 = new Point ( 6 , 9 ) ; Console . WriteLine ( overlappingArea ( l1 , r1 , l2 , r2 ) ) ; } }

Class/struct names: GFG, Point
C# program:
using System ; class GFG { static int find_Area ( int r ) { return ( 2 * r * r ) ; } public static void Main ( ) { int r = 3 ; Console . WriteLine ( " ▁ Area ▁ of ▁ square ▁ = ▁ " + find_Area ( r ) ) ; } }

Class/struct names: GFG