dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static void check_position ( int a , int b , int c , int d , int x1 , int y1 , int z1 , int x2 , int y2 , int z2 ) { int value_1 = a * x1 + b * y1 + c * z1 + d ; int value_2 = a * x2 + b * y2 + c * z2 + d ; if ( ( value_1 > 0 && value_2 > 0 ) || ( value_1 < 0 && value_2 < 0 ) ) Console . Write ( " On ▁ same ▁ side " ) ; if ( ( value_1 > 0 && value_2 < 0 ) || ( value_1 < 0 && value_2 > 0 ) ) Console . Write ( " On ▁ different ▁ sides " ) ; if ( value_1 == 0 && value_2 == 0 ) Console . Write ( " Both ▁ on ▁ the ▁ plane " ) ; if ( value_1 == 0 && value_2 != 0 ) Console . Write ( " Point ▁ 1 ▁ on ▁ the ▁ plane " ) ; if ( value_1 != 0 && value_2 == 0 ) Console . Write ( " Point ▁ 2 ▁ on ▁ the ▁ plane " ) ; } static void Main ( ) { int a = 1 , b = 2 , c = 3 , d = 4 ; int x1 = - 2 , y1 = - 2 , z1 = 1 ; int x2 = - 4 , y2 = 11 , z2 = - 1 ; check_position ( a , b , c , d , x1 , y1 , z1 , x2 , y2 , z2 ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { class pair { public int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static bool checkIntersection ( int [ ] arr , int N ) { List < pair > vec = new List < pair > ( ) ; for ( int i = 0 ; i < N - 1 ; i ++ ) { int x = arr [ i ] , y = arr [ i + 1 ] ; int minn = Math . Min ( x , y ) ; int maxx = Math . Max ( x , y ) ; vec . Add ( new pair ( minn , maxx ) ) ; } for ( int i = 0 ; i < vec . Count ; i ++ ) { pair x = vec [ i ] ; for ( int j = 0 ; j < vec . Count ; j ++ ) { pair y = vec [ j ] ; bool cond1 = ( x . first < y . first && x . second < y . second && y . first < x . second ) ; bool cond2 = ( y . first < x . first && y . second < x . second && x . first < y . second ) ; if ( cond1 cond2 ) { return true ; } } } return false ; } public static void Main ( String [ ] args ) { int [ ] arr = { 0 , 15 , 5 , 10 } ; int N = arr . Length ; if ( checkIntersection ( arr , N ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG, pair
C# program:
using System ; class GFG { static double point_distance ( int x1 , int y1 , int x2 , int y2 ) { int p = ( x2 - x1 ) ; int q = ( y2 - y1 ) ; double distance = Math . Sqrt ( p * p + q * q ) ; return distance ; } static void tangentAngle ( int x1 , int y1 , int x2 , int y2 , double radius ) { double distance = point_distance ( x1 , y1 , x2 , y2 ) ; if ( radius / distance > 1 radius / distance < - 1 ) { Console . WriteLine ( - 1 ) ; } double result = 2 * Math . Asin ( radius / distance ) * 180 / 3.1415 ; Console . WriteLine ( String . Format ( " { 0:0.0000 } " , result ) + " ▁ degrees " ) ; } static void Main ( ) { int radius = 4 ; int x1 = 7 , y1 = 12 ; int x2 = 3 , y2 = 4 ; tangentAngle ( x1 , y1 , x2 , y2 , radius ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void AreaFactor ( int n ) { double pi = 3.14159265 ; double areaf = 1 / ( Math . Cos ( pi / n ) * Math . Cos ( pi / n ) ) ; Console . WriteLine ( Math . Round ( areaf ) ) ; } public static void Main ( string [ ] args ) { int n = 4 ; AreaFactor ( n ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static readonly double PI = 3.14159265 ; static double findInteriorAngle ( int n ) { return ( ( n - 2 ) * PI ) / n ; } static double calculateSideLength ( double L , int N , int K ) { double angle = findInteriorAngle ( N ) ; double length = L * Math . Pow ( Math . Sin ( angle / 2 ) , ( K - 1 ) ) ; return length ; } public static void Main ( String [ ] args ) { double L = 21 ; int N = 5 , K = 7 ; Console . Write ( calculateSideLength ( L , N , K ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double PI = 3.14159265 ; static void findAngle ( double M1 , double M2 ) { double angle = Math . Abs ( ( M2 - M1 ) / ( 1 + M1 * M2 ) ) ; double ret = Math . Atan ( angle ) ; double val = ( ret * 180 ) / PI ; Console . Write ( val ) ; } public static void Main ( ) { double M1 = 1.75 , M2 = 0.27 ; findAngle ( M1 , M2 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float angle ( float R1 , float R2 , float D ) { float ans = ( R1 * R1 + R2 * R2 - D * D ) / ( 2 * R1 * R2 ) ; return ans ; } public static void Main ( string [ ] args ) { float R1 = 3 , R2 = 4 ; float D = 5 ; Console . Write ( angle ( R1 , R2 , D ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static String find ( int [ ] a , int [ ] b , int N , int K ) { for ( int i = 0 ; i < N ; i ++ ) { int count = 0 ; for ( int j = 0 ; j < N ; j ++ ) { if ( i == j ) { continue ; } long dis = Math . Abs ( a [ i ] - a [ j ] ) + Math . Abs ( b [ i ] - b [ j ] ) ; if ( dis <= K ) { count ++ ; } if ( count == N - 1 ) { return " Yes " ; } } } return " No " ; } public static void Main ( string [ ] args ) { int N = 5 ; int [ ] A = { 1 , 0 , 2 , 1 , 1 } ; int [ ] B = { 1 , 1 , 1 , 0 , 2 } ; int K = 1 ; Console . WriteLine ( find ( A , B , N , K ) ) ; } }

Index/key variables: i, j
Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void minimumTriangleArea ( int a , int b ) { int area = a * b ; Console . WriteLine ( area ) ; } public static void Main ( ) { int a = 1 , b = 2 ; minimumTriangleArea ( a , b ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void findAngles ( double a , double b , double c , double d ) { double numerator = a * a + d * d - b * b - c * c ; double denominator = 2 * ( a * b + c * d ) ; double x = numerator / denominator ; Console . WriteLine ( " A : ▁ " + Math . Round ( ( ( Math . Acos ( x ) * 180 ) / 3.141592 ) * 100.0 ) / 100.0 + " ▁ degrees " ) ; numerator = a * a + b * b - c * c - d * d ; x = numerator / denominator ; Console . WriteLine ( " B : ▁ " + Math . Round ( ( ( Math . Acos ( x ) * 180 ) / 3.141592 ) * 100.0 ) / 100.0 + " ▁ degrees " ) ; numerator = c * c + b * b - a * a - d * d ; x = numerator / denominator ; Console . WriteLine ( " C : ▁ " + Math . Round ( ( ( Math . Acos ( x ) * 180 ) / 3.141592 ) * 100.0 ) / 100.0 + " ▁ degrees " ) ; numerator = d * d + c * c - a * a - b * b ; x = numerator / denominator ; Console . WriteLine ( " D : ▁ " + Math . Round ( ( ( Math . Acos ( x ) * 180 ) / 3.141592 ) * 100.0 ) / 100.0 + " ▁ degrees " ) ; } public static void Main ( string [ ] args ) { double A = 10 , B = 15 , C = 20 , D = 25 ; findAngles ( A , B , C , D ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int countInscribed ( int R1 , int R2 ) { if ( R2 > R1 ) return 0 ; double angle ; double ratio ; int number_of_circles = 0 ; ratio = R2 / ( double ) ( R1 - R2 ) ; if ( R1 < 2 * R2 ) { number_of_circles = 1 ; } else { angle = Math . Abs ( Math . Asin ( ratio ) * 180 ) / 3.14159265 ; number_of_circles = ( int ) ( 360 / ( 2 * Math . Floor ( angle ) ) ) ; } return number_of_circles ; } public static void Main ( ) { int R1 = 3 ; int R2 = 1 ; Console . WriteLine ( countInscribed ( R1 , R2 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void findPairs ( int [ ] x , int [ ] y , int K ) { int n = x . Length ; int ans = 0 ; for ( int i = 0 ; i < n ; ++ i ) { for ( int j = i + 1 ; j < n ; ++ j ) { if ( K * Math . Abs ( x [ i ] - x [ j ] ) >= Math . Abs ( y [ i ] - y [ j ] ) ) { ++ ans ; } } } Console . WriteLine ( ans ) ; } public static void Main ( String [ ] args ) { int [ ] X = { 2 , 1 , 0 } ; int [ ] Y = { 1 , 2 , 0 } ; int K = 1 ; findPairs ( X , Y , K ) ; } }

Index/key variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static int totalCircles ( int L , int B ) { if ( L > B ) { int temp = L ; L = B ; B = temp ; } return B / L ; } public static void Main ( String [ ] args ) { int L = 3 ; int B = 8 ; Console . Write ( totalCircles ( L , B ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static double findDiagonal ( double s ) { return ( double ) Math . Sqrt ( 2 ) * s ; } public static void Main ( String [ ] args ) { double S = 10 ; Console . Write ( findDiagonal ( S ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static void triangleArea ( float a , float b ) { if ( a < 0 b < 0 ) { Console . WriteLine ( - 1 ) ; return ; } float area = ( 3 * ( float ) Math . Sqrt ( 3 ) * a * b ) / ( 4 ) ; Console . WriteLine ( area ) ; } public static void Main ( string [ ] args ) { float a = 1 , b = 2 ; triangleArea ( a , b ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int MAX = ( int ) ( 1e6 + 5 ) ; static void query ( double [ , ] arr , int [ ] Q ) { int [ ] pre = new int [ MAX ] ; for ( int i = 0 ; i < arr . GetLength ( 0 ) ; i ++ ) { if ( arr [ i , 0 ] < 0 arr [ i , 1 ] < 0 ) continue ; int sum = ( int ) Math . Ceiling ( ( arr [ i , 0 ] + arr [ i , 1 ] ) ) ; pre [ sum ] ++ ; } for ( int i = 1 ; i < MAX ; i ++ ) pre [ i ] += pre [ i - 1 ] ; for ( int i = 0 ; i < Q . Length ; i ++ ) { Console . Write ( pre [ Q [ i ] ] + " ▁ " ) ; } Console . WriteLine ( ) ; } public static void Main ( String [ ] args ) { double [ , ] arr = { { 2.1 , 3.0 } , { 3.7 , 1.2 } , { 1.5 , 6.5 } , { 1.2 , 0.0 } } ; int [ ] Q = { 2 , 8 , 5 } ; int N = arr . GetLength ( 0 ) ; int M = Q . Length ; query ( arr , Q ) ; } }

Index/key variables: MAX, i, sum
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Linq ; public class GFG { static bool doIntersect ( int [ ] X , int [ ] Y ) { if ( X [ 0 ] > X [ 3 ] X [ 2 ] > X [ 1 ] ) return false ; if ( Y [ 0 ] > Y [ 3 ] Y [ 2 ] > Y [ 1 ] ) return false ; return true ; } static int getUnionPerimeter ( int [ ] X , int [ ] Y ) { int perimeter = 0 ; if ( ! doIntersect ( X , Y ) ) { perimeter += 2 * ( Math . Abs ( X [ 1 ] - X [ 0 ] ) + Math . Abs ( Y [ 1 ] - Y [ 0 ] ) ) ; perimeter += 2 * ( Math . Abs ( X [ 3 ] - X [ 2 ] ) + Math . Abs ( Y [ 3 ] - Y [ 2 ] ) ) ; } else { int w = X . Max ( ) - X . Min ( ) ; int l = X . Max ( ) - Y . Min ( ) ; perimeter = 2 * ( l + w ) ; } return perimeter ; } public static void Main ( String [ ] args ) { int [ ] X = { - 1 , 2 , 4 , 6 } ; int [ ] Y = { 2 , 5 , 3 , 7 } ; Console . Write ( getUnionPerimeter ( X , Y ) ) ; } }

Accumulator variables: perimeter
Class/struct names: GFG
C# program:
using System ; public class GFG { static double Convert ( double degree ) { double pi = 3.14159265359 ; return ( degree * ( pi / 180 ) ) ; } static void areaAndHeightOfTraingle ( double radius , double a ) { if ( a >= 180 a == 0 ) { Console . WriteLine ( " Not ▁ possible " ) ; return ; } double base_angle = ( 180 - a ) / 2 ; double radians = Convert ( base_angle ) ; double height = Math . Sin ( radians ) * radius ; Console . WriteLine ( " Height ▁ of ▁ triangle ▁ " + height ) ; double Base = Math . Cos ( radians ) * radius ; double area = Base * height ; Console . WriteLine ( " Area ▁ of ▁ triangle ▁ " + area ) ; } static public void Main ( ) { double R = 5 , angle = 120 ; areaAndHeightOfTraingle ( R , angle ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double findRadius ( double r1 , double r2 ) { double a1 , a2 , a3 , r3 ; a1 = 3.14 * r1 * r1 ; a2 = 3.14 * r2 * r2 ; a3 = a1 + a2 ; r3 = Math . Sqrt ( a3 / 3.14 ) ; return r3 ; } static void Main ( ) { double r1 = 8 , r2 = 6 ; Console . WriteLine ( ( int ) findRadius ( r1 , r2 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int find_lcm ( int a , int b , int c ) { int g = __gcd ( a , b ) ; int LCM1 = ( a * b ) / g ; g = __gcd ( LCM1 , c ) ; int LCM = ( LCM1 * c ) / g ; return LCM ; } static void minimumCuboids ( int L , int B , int H ) { int lcm = find_lcm ( L , B , H ) ; int volume_cube = lcm * lcm * lcm ; int volume_cuboid = L * B * H ; Console . Write ( ( volume_cube / volume_cuboid ) ) ; } static int __gcd ( int a , int b ) { return b == 0 ? a : __gcd ( b , a % b ) ; } public static void Main ( String [ ] args ) { int L = 1 , B = 1 , H = 2 ; minimumCuboids ( L , B , H ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int CrossProduct ( int [ , ] A ) { int X1 = ( A [ 1 , 0 ] - A [ 0 , 0 ] ) ; int Y1 = ( A [ 1 , 1 ] - A [ 0 , 1 ] ) ; int X2 = ( A [ 2 , 0 ] - A [ 0 , 0 ] ) ; int Y2 = ( A [ 2 , 1 ] - A [ 0 , 1 ] ) ; return ( X1 * Y2 - Y1 * X2 ) ; } static bool isConvex ( int [ , ] points ) { int N = points . GetLength ( 0 ) ; int prev = 0 ; int curr = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int [ ] temp1 = GetRow ( points , i ) ; int [ ] temp2 = GetRow ( points , ( i + 1 ) % N ) ; int [ ] temp3 = GetRow ( points , ( i + 2 ) % N ) ; int [ , ] temp = new int [ points . GetLength ( 0 ) , points . GetLength ( 1 ) ] ; temp = newTempIn ( points , temp1 , temp2 , temp3 ) ; curr = CrossProduct ( temp ) ; if ( curr != 0 ) { if ( curr * prev < 0 ) { return false ; } else { prev = curr ; } } } return true ; } public static int [ ] GetRow ( int [ , ] matrix , int row ) { var rowLength = matrix . GetLength ( 1 ) ; var rowVector = new int [ rowLength ] ; for ( var i = 0 ; i < rowLength ; i ++ ) rowVector [ i ] = matrix [ row , i ] ; return rowVector ; } public static int [ , ] newTempIn ( int [ , ] points , int [ ] row1 , int [ ] row2 , int [ ] row3 ) { int [ , ] temp = new int [ points . GetLength ( 0 ) , points . GetLength ( 1 ) ] ; for ( var i = 0 ; i < row1 . Length ; i ++ ) { temp [ 0 , i ] = row1 [ i ] ; temp [ 1 , i ] = row2 [ i ] ; temp [ 2 , i ] = row3 [ i ] ; } return temp ; } public static void Main ( String [ ] args ) { int [ , ] points = { { 0 , 0 } , { 0 , 1 } , { 1 , 1 } , { 1 , 0 } } ; if ( isConvex ( points ) ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } }

Index/key variables: i, rowLength
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public class Tri { public int MinX , MaxX , MinY , MaxY ; } ; static int StringtoInt ( String s ) { return Int32 . Parse ( s ) ; } static int min ( int a , int b , int c ) { return Math . Min ( a , Math . Min ( b , c ) ) ; } static int max ( int a , int b , int c ) { return Math . Max ( a , Math . Max ( b , c ) ) ; } static void TriangleCuts ( int [ , ] Triangle , String [ ] Cuts , int N , int M , int COL ) { Tri [ ] Minimized = new Tri [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { Minimized [ i ] = new Tri ( ) ; Minimized [ i ] . MaxX = 0 ; Minimized [ i ] . MaxY = 0 ; Minimized [ i ] . MinX = 0 ; Minimized [ i ] . MinY = 0 ; } for ( int i = 0 ; i < N ; i ++ ) { int x1 = Triangle [ i , 0 ] ; int y1 = Triangle [ i , 1 ] ; int x2 = Triangle [ i , 2 ] ; int y2 = Triangle [ i , 3 ] ; int x3 = Triangle [ i , 4 ] ; int y3 = Triangle [ i , 5 ] ; Minimized [ i ] . MinX = min ( x1 , x2 , x3 ) ; Minimized [ i ] . MaxX = max ( x1 , x2 , x3 ) ; Minimized [ i ] . MinY = min ( y1 , y2 , y3 ) ; Minimized [ i ] . MaxY = max ( y1 , y2 , y3 ) ; } for ( int i = 0 ; i < M ; i ++ ) { String Cut = Cuts [ i ] ; int CutCount = 0 ; int CutVal = StringtoInt ( Cut . Substring ( 2 , Cut . Length - 2 ) ) ; if ( Cut [ 0 ] == ' X ' ) { for ( int j = 0 ; j < N ; j ++ ) { if ( ( Minimized [ j ] . MinX ) < ( CutVal ) & & ( Minimized [ j ] . MaxX ) > ( CutVal ) ) { CutCount ++ ; } } } else if ( Cut [ 0 ] == ' Y ' ) { for ( int j = 0 ; j < N ; j ++ ) { if ( ( Minimized [ j ] . MinY ) < ( CutVal ) & & ( Minimized [ j ] . MaxY ) > ( CutVal ) ) { CutCount ++ ; } } } Console . Write ( CutCount + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int [ , ] Triangle = { { 0 , 2 , 2 , 9 , 8 , 5 } , { 5 , 0 , 6 , 3 , 7 , 0 } } ; int N = Triangle . GetLength ( 0 ) ; int COL = 6 ; String [ ] Cuts = { " X = 2" , " Y = 2" , " Y = 9" } ; int M = Cuts . Length ; TriangleCuts ( Triangle , Cuts , N , M , COL ) ; } }

Index/key variables: N, i, j
Accumulator variables: CutCount, i, j
Iterator variables: i, j
Class/struct names: GFG, Tri
C# program:
using System ; using System . Collections . Generic ; class GFG { public static int cntRect ( int [ , ] points , int N , int [ , ] rectangle ) { HashSet < int > cntHor = new HashSet < int > ( ) ; HashSet < int > cntVer = new HashSet < int > ( ) ; cntHor . Add ( 0 ) ; cntVer . Add ( 0 ) ; cntHor . Add ( rectangle [ 3 , 0 ] ) ; cntVer . Add ( rectangle [ 3 , 1 ] ) ; for ( int i = 0 ; i < N ; i ++ ) { cntHor . Add ( points [ i , 0 ] ) ; cntVer . Add ( points [ i , 1 ] ) ; } return ( cntHor . Count - 1 ) * ( cntVer . Count - 1 ) ; } public static void Main ( String [ ] args ) { int [ , ] rectangle = { { 0 , 0 } , { 0 , 5 } , { 5 , 0 } , { 5 , 5 } } ; int [ , ] points = { { 1 , 2 } , { 3 , 4 } } ; int N = points . GetLength ( 0 ) ; Console . WriteLine ( cntRect ( points , N , rectangle ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int numberOfSquares ( int [ ] X , int [ ] Y , int N , int M ) { Dictionary < int , int > m1 = new Dictionary < int , int > ( ) ; Dictionary < int , int > m2 = new Dictionary < int , int > ( ) ; int i , j , ans = 0 ; for ( i = 0 ; i < N ; i ++ ) { for ( j = i + 1 ; j < N ; j ++ ) { int dist = Math . Abs ( X [ i ] - X [ j ] ) ; if ( m1 . ContainsKey ( dist ) ) m1 [ dist ] ++ ; else m1 . Add ( dist , 1 ) ; } } for ( i = 0 ; i < M ; i ++ ) { for ( j = i + 1 ; j < M ; j ++ ) { int dist = Math . Abs ( Y [ i ] - Y [ j ] ) ; if ( m2 . ContainsKey ( dist ) ) m2 [ dist ] ++ ; else m2 . Add ( dist , 1 ) ; } } foreach ( KeyValuePair < int , int > entry in m1 ) { if ( m2 . ContainsKey ( entry . Key ) ) { ans += ( entry . Value * m2 [ entry . Key ] ) ; } } return ans ; } public static void Main ( ) { int [ ] X = { 1 , 3 , 7 } ; int [ ] Y = { 2 , 4 , 6 , 1 } ; int N = X . Length ; int M = Y . Length ; Console . WriteLine ( numberOfSquares ( X , Y , N , M ) ) ; } }

Index/key variables: dist, i, j
Accumulator variables: ans, i, j
Iterator variables: entry, i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int No_of_squares ( int N , int K ) { int no_of_squares = 0 ; no_of_squares = ( N - K + 1 ) * ( N - K + 1 ) ; return no_of_squares ; } public static void Main ( String [ ] args ) { int N = 5 ; int K = 3 ; Console . Write ( No_of_squares ( N , K ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int No_of_cubes ( int N , int K ) { int No = 0 ; No = ( N - K + 1 ) ; No = ( int ) Math . Pow ( No , 3 ) ; return No ; } public static void Main ( ) { int N = 5 ; int K = 2 ; Console . Write ( No_of_cubes ( N , K ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static 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 ) ; } } public static void Main ( String [ ] args ) { int L = 5 , B = 3 ; int l = 4 , b = 1 ; Console . Write ( No_of_rectangles ( L , B , l , b ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void checkTriangle ( int x , int y , int z ) { if ( x == y && y == z ) Console . WriteLine ( " Equilateral ▁ Triangle " ) ; else if ( x == y y == z z == x ) Console . WriteLine ( " Isosceles ▁ Triangle " ) ; else Console . WriteLine ( " Scalene ▁ Triangle " ) ; } public static void Main ( ) { int x = 8 , y = 7 , z = 9 ; checkTriangle ( x , y , z ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void findVertices ( int x1 , int y1 , int x2 , int y2 ) { if ( x1 == x2 ) { Console . Write ( ( x1 + y2 - y1 ) + " , ▁ " + y1 + " STRNEWLINE " ) ; Console . Write ( ( x2 + y2 - y1 ) + " , ▁ " + y2 ) ; } else if ( y1 == y2 ) { Console . Write ( x1 + " , ▁ " + ( y1 + x2 - x1 ) + " STRNEWLINE " ) ; Console . Write ( x2 + " , ▁ " + ( y2 + x2 - x1 ) ) ; } else if ( Math . Abs ( x2 - x1 ) == Math . Abs ( y2 - y1 ) ) { Console . Write ( x1 + " , ▁ " + y2 + " STRNEWLINE " ) ; Console . Write ( x2 + " , ▁ " + y1 ) ; } else Console . Write ( " - 1" ) ; } public static void Main ( String [ ] args ) { int x1 = 1 , y1 = 2 ; int x2 = 3 , y2 = 4 ; findVertices ( x1 , y1 , x2 , y2 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static readonly double RADIAN = 0.01745329252 ; static double Area_of_Rhombus ( int a , int theta ) { double area = ( a * a ) * Math . Sin ( ( RADIAN * theta ) ) ; return area ; } public static void Main ( String [ ] args ) { int a = 4 ; int theta = 60 ; double ans = Area_of_Rhombus ( a , theta ) ; Console . Write ( " { 0 : F2 } " , ans ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int calculateTriangles ( int [ ] sides ) { double count = Math . Pow ( sides [ 0 ] + sides [ 1 ] + sides [ 2 ] , 2 ) ; count -= Math . Pow ( sides [ 0 ] , 2 ) ; count -= Math . Pow ( sides [ 2 ] , 2 ) ; count -= Math . Pow ( sides [ 4 ] , 2 ) ; return ( int ) ( count ) ; } public static void Main ( String [ ] args ) { int [ ] sides = { 1 , 1 , 1 , 1 , 1 , 1 } ; Console . Write ( ( calculateTriangles ( sides ) ) + " STRNEWLINE " ) ; int [ ] sides1 = { 2 , 2 , 1 , 3 , 1 , 2 } ; Console . Write ( ( calculateTriangles ( sides1 ) ) + " STRNEWLINE " ) ; } }

Accumulator variables: count
Class/struct names: GFG
C# program:
using System ; class GFG { static double Length_Diagonal ( int a , int b , double theta ) { double diagonal = Math . Sqrt ( ( Math . Pow ( a , 2 ) + Math . Pow ( b , 2 ) ) - 2 * a * b * Math . Cos ( theta * ( Math . PI / 180 ) ) ) ; return diagonal ; } public static void Main ( String [ ] args ) { int a = 3 ; int b = 5 ; double theta = 45 ; double ans = Length_Diagonal ( a , b , theta ) ; Console . Write ( " { 0 : F2 } " , ans ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void maximumTiles ( int n , int m ) { Console . WriteLine ( ( m * n ) / 2 ) ; } public static void Main ( String [ ] args ) { int M = 3 ; int N = 4 ; maximumTiles ( N , M ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float Length_Diagonal ( int a , int b , int d ) { float diagonal = ( float ) Math . Sqrt ( 2 * ( ( a * a ) + ( b * b ) ) - ( d * d ) ) ; return diagonal ; } public static void Main ( String [ ] args ) { int A = 10 ; int B = 30 ; int D = 20 ; float ans = Length_Diagonal ( A , B , D ) ; Console . Write ( " { 0 : F1 } " , ans ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static List < float > Diagonals ( int a , int b , int c , int d ) { List < float > ans = new List < float > ( ) ; ans . Add ( ( float ) Math . Sqrt ( ( ( a * c ) + ( b * d ) ) * ( ( a * d ) + ( b * c ) ) / ( ( a * b ) + ( c * d ) ) ) ) ; ans . Add ( ( float ) Math . Sqrt ( ( ( a * c ) + ( b * d ) ) * ( ( a * b ) + ( c * d ) ) / ( ( a * d ) + ( b * c ) ) ) ) ; return ans ; } public static void Main ( String [ ] args ) { int A = 10 ; int B = 15 ; int C = 20 ; int D = 25 ; List < float > ans = Diagonals ( A , B , C , D ) ; Console . Write ( " { 0 : F2 } ▁ { 1 : F2 } " , ( ans [ 0 ] ) + .01 , ans [ 1 ] + .01 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double find ( double x , double y , int [ , ] p ) { double mind = 0 ; for ( int i = 0 ; i < p . GetLength ( 0 ) ; i ++ ) { double a = p [ i , 0 ] , b = p [ i , 1 ] ; mind += Math . Sqrt ( ( x - a ) * ( x - a ) + ( y - b ) * ( y - b ) ) ; } return mind ; } static double getMinDistSum ( int [ , ] p ) { double x = 0 , y = 0 ; for ( int i = 0 ; i < p . GetLength ( 0 ) ; i ++ ) { x += p [ i , 0 ] ; y += p [ i , 1 ] ; } x = x / p . Length ; y = y / p . Length ; double mind = find ( x , y , p ) ; return mind ; } public static void Main ( String [ ] args ) { int [ , ] vec = { { 0 , 1 } , { 1 , 0 } , { 1 , 2 } , { 2 , 1 } } ; int d = ( int ) getMinDistSum ( vec ) ; Console . Write ( d + " STRNEWLINE " ) ; } }

Accumulator variables: i, mind, x, y
Iterator variables: i
Class/struct names: GFG