dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static int N = 9 ; static void print ( int [ , ] grid ) { for ( int i = 0 ; i < N ; i ++ ) { for ( int j = 0 ; j < N ; j ++ ) Console . Write ( grid [ i , j ] + " ▁ " ) ; Console . WriteLine ( ) ; } } static bool isSafe ( int [ , ] grid , int row , int col , int num ) { for ( int x = 0 ; x <= 8 ; x ++ ) if ( grid [ row , x ] == num ) return false ; for ( int x = 0 ; x <= 8 ; x ++ ) if ( grid [ x , col ] == num ) return false ; int startRow = row - row % 3 , startCol = col - col % 3 ; for ( int i = 0 ; i < 3 ; i ++ ) for ( int j = 0 ; j < 3 ; j ++ ) if ( grid [ i + startRow , j + startCol ] == num ) return false ; return true ; } static bool solveSuduko ( int [ , ] grid , int row , int col ) { if ( row == N - 1 && col == N ) return true ; if ( col == N ) { row ++ ; col = 0 ; } if ( grid [ row , col ] != 0 ) return solveSuduko ( grid , row , col + 1 ) ; for ( int num = 1 ; num < 10 ; num ++ ) { if ( isSafe ( grid , row , col , num ) ) { grid [ row , col ] = num ; if ( solveSuduko ( grid , row , col + 1 ) ) return true ; } grid [ row , col ] = 0 ; } return false ; } static void Main ( ) { int [ , ] grid = { { 3 , 0 , 6 , 5 , 0 , 8 , 4 , 0 , 0 } , { 5 , 2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } , { 0 , 8 , 7 , 0 , 0 , 0 , 0 , 3 , 1 } , { 0 , 0 , 3 , 0 , 1 , 0 , 0 , 8 , 0 } , { 9 , 0 , 0 , 8 , 6 , 3 , 0 , 0 , 5 } , { 0 , 5 , 0 , 0 , 9 , 0 , 6 , 0 , 0 } , { 1 , 3 , 0 , 0 , 0 , 0 , 2 , 5 , 0 } , { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 4 } , { 0 , 0 , 5 , 2 , 0 , 6 , 3 , 0 , 0 } } ; if ( solveSuduko ( grid , 0 , 0 ) ) print ( grid ) ; else Console . WriteLine ( " No ▁ Solution ▁ exists " ) ; } }

Accumulator variables: i, j, num, row, x
Iterator variables: i, j, num, x
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void printpairs ( int [ ] arr , int sum ) { HashSet < int > s = new HashSet < int > ( ) ; for ( int i = 0 ; i < arr . Length ; ++ i ) { int temp = sum - arr [ i ] ; if ( s . Contains ( temp ) ) { Console . Write ( " Pair ▁ with ▁ given ▁ sum ▁ " + sum + " ▁ is ▁ ( " + arr [ i ] + " , ▁ " + temp + " ) " ) ; } s . Add ( arr [ i ] ) ; } } static void Main ( ) { int [ ] A = new int [ ] { 1 , 4 , 45 , 6 , 10 , 8 } ; int n = 16 ; printpairs ( A , n ) ; } }

Index/key variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class Node { public int data ; public Node left , right ; public Node ( int item ) { data = item ; left = right = null ; } } class Result { public int res = 0 ; } class GFG { Node root ; private void longestConsecutiveUtil ( Node root , int curlength , int expected , Result res ) { if ( root == null ) return ; if ( root . data == expected ) curlength ++ ; else curlength = 1 ; res . res = Math . Max ( res . res , curlength ) ; longestConsecutiveUtil ( root . left , curlength , root . data + 1 , res ) ; longestConsecutiveUtil ( root . right , curlength , root . data + 1 , res ) ; } int longestConsecutive ( Node root ) { if ( root == null ) return 0 ; Result res = new Result ( ) ; longestConsecutiveUtil ( root , 0 , root . data , res ) ; return res . res ; } public static void Main ( String [ ] args ) { GFG tree = new GFG ( ) ; tree . root = new Node ( 6 ) ; tree . root . right = new Node ( 9 ) ; tree . root . right . left = new Node ( 7 ) ; tree . root . right . right = new Node ( 10 ) ; tree . root . right . right . right = new Node ( 11 ) ; Console . WriteLine ( tree . longestConsecutive ( tree . root ) ) ; } }

Accumulator variables: curlength
Class/struct names: GFG, Node, Result
C# program:
using System ; class GFG { static long power ( long x , long y , long p ) { long res = 1 ; x = x % p ; if ( x == 0 ) return 0 ; while ( y > 0 ) { if ( ( y & 1 ) == 1 ) res = ( res * x ) % p ; y = y >> 1 ; x = ( x * x ) % p ; } return res ; } static long remainder ( long n , long a , long p ) { long ans = a % p ; for ( long i = 1 ; i <= n ; i ++ ) ans = power ( ans , i , p ) ; return ans ; } public static void Main ( String [ ] args ) { long A = 2 , N = 1 , P = 2 ; Console . Write ( remainder ( N , A , P ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findMajority ( int [ ] arr , int n ) { int count1 = 0 , count2 = 0 ; int flag = 0 ; int first = Int32 . MinValue ; int second = Int32 . MaxValue ; for ( int i = 0 ; i < n ; i ++ ) { if ( first == arr [ i ] ) count1 ++ ; else if ( second == arr [ i ] ) count2 ++ ; else if ( count1 == 0 ) { count1 ++ ; first = arr [ i ] ; } else if ( count2 == 0 ) { count2 ++ ; second = arr [ i ] ; } else { count1 -- ; count2 -- ; } } count1 = 0 ; count2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == first ) count1 ++ ; else if ( arr [ i ] == second ) count2 ++ ; } if ( count1 > n / 3 ) { Console . Write ( first + " ▁ " ) ; flag = 1 ; } if ( count2 > n / 3 ) { Console . Write ( second + " ▁ " ) ; flag = 1 ; } if ( flag == 0 ) Console . Write ( " No ▁ Majority ▁ Element " ) ; } static void Main ( ) { int [ ] arr = { 2 , 2 , 3 , 1 , 3 , 2 , 1 , 1 } ; int n = arr . Length ; findMajority ( arr , n ) ; } }

Index/key variables: i
Accumulator variables: count1, count2, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public class pair { public int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static pair Multiply ( pair p , pair q , int M ) { int x = ( ( p . first * q . first ) % M - ( p . second * q . second ) % M + M ) % M ; int y = ( ( p . first * q . second ) % M + ( p . second * q . first ) % M ) % M ; return new pair ( x , y ) ; } static pair compPow ( pair complex , int k , int M ) { pair res = new pair ( 1 , 0 ) ; while ( k > 0 ) { if ( k % 2 == 1 ) { res = Multiply ( res , complex , M ) ; } complex = Multiply ( complex , complex , M ) ; k = k >> 1 ; } return res ; } public static void Main ( String [ ] args ) { int A = 7 , B = 3 , k = 10 , M = 97 ; pair ans = compPow ( new pair ( A , B ) , k , M ) ; Console . WriteLine ( ans . first + " ▁ + ▁ i " + ans . second ) ; } }

Class/struct names: GFG, pair
C# program:
using System ; class GFG { class pair { public int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static readonly int seg_max = 51 ; static pair [ ] seg_tree = new pair [ seg_max ] ; static int n ; static pair buildMaxTree ( int l , int r , int i , int [ ] arr ) { if ( l == r ) { seg_tree [ i ] = new pair ( arr [ l ] , l ) ; return seg_tree [ i ] ; } seg_tree [ i ] = max ( buildMaxTree ( l , ( l + r ) / 2 , 2 * i + 1 , arr ) , buildMaxTree ( ( l + r ) / 2 + 1 , r , 2 * i + 2 , arr ) ) ; return seg_tree [ i ] ; } static pair rangeMax ( int l , int r , int [ ] arr , int i , int sl , int sr ) { if ( sr < l sl > r ) return new pair ( int . MinValue , - 1 ) ; if ( sl >= l && sr <= r ) return seg_tree [ i ] ; return max ( rangeMax ( l , r , arr , 2 * i + 1 , sl , ( sl + sr ) / 2 ) , rangeMax ( l , r , arr , 2 * i + 2 , ( sl + sr ) / 2 + 1 , sr ) ) ; } static pair max ( pair f , pair s ) { if ( f . first > s . first ) return f ; else return s ; } static int maxSumSubarray ( int [ ] arr , int l , int r ) { if ( l > r ) return 0 ; pair a = rangeMax ( l , r , arr , 0 , 0 , n - 1 ) ; return a . first * ( r - a . second + 1 ) * ( a . second - l + 1 ) + maxSumSubarray ( arr , l , a . second - 1 ) + maxSumSubarray ( arr , a . second + 1 , r ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 3 , 1 , 7 } ; n = arr . Length ; buildMaxTree ( 0 , n - 1 , 0 , arr ) ; Console . Write ( maxSumSubarray ( arr , 0 , n - 1 ) ) ; } }

Index/key variables: i, l, seg_max
Class/struct names: GFG, pair
C# program:
class GFG { static int exponentMod ( int A , int B , int C ) { if ( A == 0 ) return 0 ; if ( B == 0 ) return 1 ; long y ; if ( B % 2 == 0 ) { y = exponentMod ( A , B / 2 , C ) ; y = ( y * y ) % C ; } else { y = A % C ; y = ( y * exponentMod ( A , B - 1 , C ) % C ) % C ; } return ( int ) ( ( y + C ) % C ) ; } public static void Main ( ) { int A = 2 , B = 5 , C = 13 ; System . Console . WriteLine ( " Power ▁ is ▁ " + exponentMod ( A , B , C ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static void findFrequencies ( int [ ] ele ) { int freq = 1 ; int idx = 1 ; int element = ele [ 0 ] ; while ( idx < ele . Length ) { if ( ele [ idx - 1 ] == ele [ idx ] ) { freq ++ ; idx ++ ; } else { Console . WriteLine ( element + " ▁ " + freq ) ; element = ele [ idx ] ; idx ++ ; freq = 1 ; } } Console . WriteLine ( element + " ▁ " + freq ) ; } public static void Main ( String [ ] args ) { Console . WriteLine ( " - - - frequencies ▁ in ▁ a ▁ sorted ▁ array - - - - " ) ; findFrequencies ( new int [ ] { 10 , 20 , 30 , 30 , 30 , 40 , 50 , 50 , 50 , 50 , 70 } ) ; } }

Index/key variables: idx
Accumulator variables: freq, idx
Class/struct names: GFG
C# program:
using System ; public class GFG { static int power ( int x , int y , int p ) { int res = 1 ; x = x % p ; if ( x == 0 ) return 0 ; while ( y > 0 ) { if ( ( y & 1 ) != 0 ) res = ( res * x ) % p ; y = y >> 1 ; y = y / 2 x = ( x * x ) % p ; } return res ; } static public void Main ( ) { int x = 2 ; int y = 5 ; int p = 13 ; Console . Write ( " Power ▁ is ▁ " + power ( x , y , p ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { public class Node { public int key ; public Node left ; public Node right ; } ; static Node newNode ( int key ) { Node node = new Node ( ) ; node . left = null ; node . right = null ; node . key = key ; return node ; } static int maxBends ; static int len ; static void findMaxBendsUtil ( Node node , char dir , int bends , int soFar ) { if ( node == null ) return ; if ( node . left == null && node . right == null ) { if ( bends > maxBends ) { maxBends = bends ; len = soFar ; } } else { if ( dir == ' l ' ) { findMaxBendsUtil ( node . left , dir , bends , soFar + 1 ) ; findMaxBendsUtil ( node . right , ' r ' , bends + 1 , soFar + 1 ) ; } else { findMaxBendsUtil ( node . right , dir , bends , soFar + 1 ) ; findMaxBendsUtil ( node . left , ' l ' , bends + 1 , soFar + 1 ) ; } } } static int findMaxBends ( Node node ) { if ( node == null ) return 0 ; len = 0 ; maxBends = - 1 ; int bends = 0 ; if ( node . left != null ) findMaxBendsUtil ( node . left , ' l ' , bends , 1 ) ; if ( node . right != null ) findMaxBendsUtil ( node . right , ' r ' , bends , 1 ) ; len ++ ; return len ; } public static void Main ( String [ ] args ) { Node root = newNode ( 10 ) ; root . left = newNode ( 8 ) ; root . right = newNode ( 2 ) ; root . left . left = newNode ( 3 ) ; root . left . right = newNode ( 5 ) ; root . right . left = newNode ( 2 ) ; root . right . left . right = newNode ( 1 ) ; root . right . left . right . left = newNode ( 9 ) ; Console . Write ( findMaxBends ( root ) - 1 ) ; } }

Accumulator variables: len
Class/struct names: GFG, Node
C# program:
using System ; using System . Collections . Generic ; class GFG { static double magnitude ( double [ ] arr , int N ) { double magnitude = 0 ; for ( int i = 0 ; i < N ; i ++ ) magnitude += arr [ i ] * arr [ i ] ; return Math . Sqrt ( magnitude ) ; } static double dotProduct ( double [ ] arr , double [ ] brr , int N ) { double product = 0 ; for ( int i = 0 ; i < N ; i ++ ) product = product + arr [ i ] * brr [ i ] ; return product ; } static void angleBetweenVectors ( double [ ] arr , double [ ] brr , int N ) { double dotProductOfVectors = dotProduct ( arr , brr , N ) ; double magnitudeOfA = magnitude ( arr , N ) ; double magnitudeOfB = magnitude ( brr , N ) ; double angle = dotProductOfVectors / ( magnitudeOfA * magnitudeOfB ) ; Console . Write ( angle ) ; } public static void Main ( ) { double [ ] arr = { - 0.5 , - 2 , 1 } ; double [ ] brr = { - 1 , - 1 , 0.3 } ; int N = arr . Length ; angleBetweenVectors ( arr , brr , N ) ; } }

Index/key variables: i
Accumulator variables: i, magnitude
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void secondary_polygon ( int Angle ) { int edges_primary = 360 / Angle ; if ( edges_primary >= 6 ) { int edges_max_secondary = edges_primary / 2 ; Console . WriteLine ( edges_max_secondary + 3 ) ; } else Console . WriteLine ( " Not ▁ Possible " ) ; } public static void Main ( string [ ] args ) { int Angle = 45 ; secondary_polygon ( Angle ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double circleArea ( double r ) { double pi = 3.14159265358979323846 ; return ( pi * r * r ) ; } static double findCircleAreaByMedian ( int m ) { double r = 2 * m / 3 ; return circleArea ( r ) ; } public static void Main ( string [ ] args ) { int m = 3 ; Console . WriteLine ( " { 0 : f4 } " , findCircleAreaByMedian ( m ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class Turns_to_reach_another_node { public static int Count ; public class Node { public Node left , right ; public int key ; public Node ( int key ) { this . key = key ; left = null ; right = null ; } } public static Node findLCA ( Node root , int n1 , int n2 ) { if ( root == null ) { return null ; } if ( root . key == n1 root . key == n2 ) { return root ; } Node left_lca = findLCA ( root . left , n1 , n2 ) ; Node right_lca = findLCA ( root . right , n1 , n2 ) ; if ( left_lca != null && right_lca != null ) { return root ; } return ( left_lca != null ) ? left_lca : right_lca ; } public static bool CountTurn ( Node root , int key , bool turn ) { if ( root == null ) { return false ; } if ( root . key == key ) { return true ; } if ( turn == true ) { if ( CountTurn ( root . left , key , turn ) ) { return true ; } if ( CountTurn ( root . right , key , ! turn ) ) { Count += 1 ; return true ; } } else { if ( CountTurn ( root . right , key , turn ) ) { return true ; } if ( CountTurn ( root . left , key , ! turn ) ) { Count += 1 ; return true ; } } return false ; } public static int NumberOfTurn ( Node root , int first , int second ) { Node LCA = findLCA ( root , first , second ) ; if ( LCA == null ) { return - 1 ; } Count = 0 ; if ( LCA . key != first && LCA . key != second ) { if ( CountTurn ( LCA . right , second , false ) || CountTurn ( LCA . left , second , true ) ) { ; } if ( CountTurn ( LCA . left , first , true ) || CountTurn ( LCA . right , first , false ) ) { ; } return Count + 1 ; } if ( LCA . key == first ) { CountTurn ( LCA . right , second , false ) ; CountTurn ( LCA . left , second , true ) ; return Count ; } else { CountTurn ( LCA . right , first , false ) ; CountTurn ( LCA . left , first , true ) ; return Count ; } } public static void Main ( string [ ] args ) { Node root = new Node ( 1 ) ; root . left = new Node ( 2 ) ; root . right = new Node ( 3 ) ; root . left . left = new Node ( 4 ) ; root . left . right = new Node ( 5 ) ; root . right . left = new Node ( 6 ) ; root . right . right = new Node ( 7 ) ; root . left . left . left = new Node ( 8 ) ; root . right . left . left = new Node ( 9 ) ; root . right . left . right = new Node ( 10 ) ; int turn = 0 ; if ( ( turn = NumberOfTurn ( root , 5 , 10 ) ) != 0 ) { Console . WriteLine ( turn ) ; } else { Console . WriteLine ( " Not ▁ Possible " ) ; } } }

Accumulator variables: Count
Class/struct names: Node, Turns_to_reach_another_node
C# program:
using System ; class GFG { static void checkTypeOfTriangle ( int a , int b , int c ) { int sqa = ( int ) Math . Pow ( a , 2 ) ; int sqb = ( int ) Math . Pow ( b , 2 ) ; int sqc = ( int ) Math . Pow ( c , 2 ) ; if ( sqa == sqa + sqb sqb == sqa + sqc sqc == sqa + sqb ) { Console . Write ( " Right - angled ▁ Triangle " ) ; } else if ( sqa > sqc + sqb sqb > sqa + sqc sqc > sqa + sqb ) { Console . Write ( " Obtuse - angled ▁ Triangle " ) ; } else { Console . Write ( " Acute - angled ▁ Triangle " ) ; } } public static void Main ( String [ ] args ) { int a , b , c ; a = 2 ; b = 2 ; c = 2 ; checkTypeOfTriangle ( a , b , c ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static int Valid ( int a , int b , int c ) { if ( a + b + c == 180 && a != 0 && b != 0 && c != 0 ) return 1 ; else return 0 ; } public static void Main ( ) { int a = 60 , b = 40 , c = 80 ; if ( ( Valid ( a , b , c ) ) == 1 ) Console . WriteLine ( " Valid " ) ; else Console . WriteLine ( " Invalid " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double trianglearea ( double a ) { if ( a < 0 ) return - 1 ; double area = ( 3 * Math . Sqrt ( 3 ) * Math . Pow ( a , 2 ) ) / 4 ; return Math . Round ( area , 4 ) ; } public static void Main ( ) { double a = 6 ; Console . WriteLine ( trianglearea ( a ) ) ; } }

Class/struct names: GFG
C# program:
class solution { static void equation_ellipse ( float x1 , float y1 , float a , float b , float c , float e ) { float t = a * a + b * b ; float a1 = t - e * ( a * a ) ; float b1 = t - e * ( b * b ) ; float c1 = ( - 2 * t * x1 ) - ( 2 * e * c * a ) ; float d1 = ( - 2 * t * y1 ) - ( 2 * e * c * b ) ; float e1 = - 2 * e * a * b ; float f1 = ( - e * c * c ) + ( t * x1 * x1 ) + ( t * y1 * y1 ) ; System . Console . WriteLine ( " Equation ▁ of ▁ ellipse ▁ is ▁ " ) ; System . Console . WriteLine ( a1 + " ▁ x ^ 2 ▁ + ▁ " + b1 + " ▁ y ^ 2 ▁ + ▁ " + c1 + " ▁ x ▁ + ▁ " + d1 + " ▁ y ▁ + ▁ " + e1 + " ▁ xy ▁ + ▁ " + f1 + " ▁ = ▁ 0" ) ; } public static void Main ( ) { float x1 = 1 , y1 = 1 , a = 1 , b = - 1 , c = 3 , e = ( float ) 0.5 * ( float ) 0.5 ; equation_ellipse ( x1 , y1 , a , b , c , e ) ; } }

Class/struct names: solution
C# program:
using System ; using System . Collections . Generic ; class GFG { public class Node { public int data ; public Node left , right , abtr ; } ; static Node newNode ( int data ) { Node node = new Node ( ) ; node . data = data ; node . left = node . right = node . abtr = null ; return node ; } static List < Node > even_ptrs = new List < Node > ( ) ; static List < Node > odd_ptrs = new List < Node > ( ) ; static void preorderTraversal ( Node root ) { if ( root == null ) return ; if ( root . data % 2 == 0 ) ( even_ptrs ) . Add ( root ) ; else ( odd_ptrs ) . Add ( root ) ; preorderTraversal ( root . left ) ; preorderTraversal ( root . right ) ; } static void createLoops ( Node root ) { preorderTraversal ( root ) ; int i ; for ( i = 1 ; i < even_ptrs . Count ; i ++ ) even_ptrs [ i - 1 ] . abtr = even_ptrs [ i ] ; even_ptrs [ i - 1 ] . abtr = even_ptrs [ 0 ] ; for ( i = 1 ; i < odd_ptrs . Count ; i ++ ) odd_ptrs [ i - 1 ] . abtr = odd_ptrs [ i ] ; odd_ptrs [ i - 1 ] . abtr = odd_ptrs [ 0 ] ; } static void traverseLoop ( Node start ) { Node curr = start ; do { Console . Write ( curr . data + " ▁ " ) ; curr = curr . abtr ; } while ( curr != start ) ; } public static void Main ( String [ ] args ) { Node root = null ; root = newNode ( 1 ) ; root . left = newNode ( 2 ) ; root . right = newNode ( 3 ) ; root . left . left = newNode ( 4 ) ; root . left . right = newNode ( 5 ) ; root . right . left = newNode ( 6 ) ; root . right . right = newNode ( 7 ) ; createLoops ( root ) ; Console . Write ( " Odd ▁ nodes : ▁ " ) ; traverseLoop ( root . right ) ; Console . Write ( " STRNEWLINE Even ▁ nodes : ▁ " ) ; traverseLoop ( root . left ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG, Node
C# program:
using System ; class GFG { static double PI = 3.14 ; static double circle_inscribed ( int a ) { return PI * ( a * a ) / 12 ; } public static void Main ( ) { int a = 4 ; Console . WriteLine ( circle_inscribed ( a ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void findVolume ( double u , double v , double w , double U , double V , double W , double b ) { double uPow = Math . Pow ( u , 2 ) ; double vPow = Math . Pow ( v , 2 ) ; double wPow = Math . Pow ( w , 2 ) ; double UPow = Math . Pow ( U , 2 ) ; double VPow = Math . Pow ( V , 2 ) ; double WPow = Math . Pow ( W , 2 ) ; double a = 4 * ( uPow * vPow * wPow ) - uPow * Math . Pow ( ( vPow + wPow - UPow ) , 2 ) - vPow * Math . Pow ( ( wPow + uPow - VPow ) , 2 ) - wPow * Math . Pow ( ( uPow + vPow - WPow ) , 2 ) + ( vPow + wPow - UPow ) * ( wPow + uPow - VPow ) * ( uPow + vPow - WPow ) ; double vol = Math . Sqrt ( a ) ; vol /= b ; Console . Write ( System . Math . Round ( vol , 4 ) ) ; } public static void Main ( ) { double u = 1000 , v = 1000 , w = 1000 ; double U = 3 , V = 4 , W = 5 ; double b = 12 ; findVolume ( u , v , w , U , V , W , b ) ; } }

Accumulator variables: vol
Class/struct names: GFG
C# program:
using System ; class GFG { static void makePolygon ( double a ) { double n = 360 / ( 180 - a ) ; if ( n == ( int ) n ) Console . WriteLine ( " YES " ) ; else Console . WriteLine ( " NO " ) ; } static void Main ( ) { double a = 90 ; makePolygon ( a ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int getQuadrant ( int X , int Y , int R , int PX , int PY ) { if ( PX == X && PY == Y ) return 0 ; int val = ( int ) Math . Pow ( ( PX - X ) , 2 ) + ( int ) Math . Pow ( ( PY - Y ) , 2 ) ; if ( val > Math . Pow ( R , 2 ) ) return - 1 ; if ( PX > X && PY >= Y ) return 1 ; if ( PX <= X && PY > Y ) return 2 ; if ( PX < X && PY <= Y ) return 3 ; if ( PX >= X && PY < Y ) return 4 ; return 0 ; } public static void Main ( ) { int X = 0 , Y = 3 ; int R = 2 ; int PX = 1 , PY = 4 ; int ans = getQuadrant ( X , Y , R , PX , PY ) ; if ( ans == - 1 ) Console . WriteLine ( " Lies ▁ Outside " + " ▁ the ▁ circle " ) ; else if ( ans == 0 ) Console . WriteLine ( " Coincides ▁ " + " with ▁ centre " ) ; else Console . WriteLine ( ans + " ▁ Quadrant " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static long hexadecagonalNum ( long n ) { return ( ( 14 * n * n ) - 12 * n ) / 2 ; } public static void Main ( ) { long n = 5 ; Console . WriteLine ( n + " th ▁ " + " Hexadecagonal ▁ number ▁ : ▁ " + hexadecagonalNum ( n ) ) ; n = 9 ; Console . WriteLine ( n + " th ▁ " + " Hexadecagonal ▁ number ▁ : ▁ " + hexadecagonalNum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GfG { public class Node { public int data ; public Node left , right ; } static Node newNode ( int x ) { Node temp = new Node ( ) ; temp . data = x ; temp . left = null ; temp . right = null ; return temp ; } static bool isLeaf ( Node t ) { return ( ( t . left == null ) && ( t . right == null ) ) ; } static void findFirstUnmatch ( Node root1 , Node root2 ) { if ( root1 == null root2 == null ) return ; Stack < Node > s1 = new Stack < Node > ( ) ; Stack < Node > s2 = new Stack < Node > ( ) ; s1 . Push ( root1 ) ; s2 . Push ( root2 ) ; while ( s1 . Count != 0 s2 . Count != 0 ) { if ( s1 . Count == 0 s2 . Count == 0 ) return ; Node temp1 = s1 . Peek ( ) ; s1 . Pop ( ) ; while ( temp1 != null && isLeaf ( temp1 ) != true ) { s1 . Push ( temp1 . right ) ; s1 . Push ( temp1 . left ) ; temp1 = s1 . Peek ( ) ; s1 . Pop ( ) ; } Node temp2 = s2 . Peek ( ) ; s2 . Pop ( ) ; while ( temp2 != null && isLeaf ( temp2 ) != true ) { s2 . Push ( temp2 . right ) ; s2 . Push ( temp2 . left ) ; temp2 = s2 . Peek ( ) ; s2 . Pop ( ) ; } if ( temp1 != null && temp2 != null ) { if ( temp1 . data != temp2 . data ) { Console . WriteLine ( temp1 . data + " ▁ " + temp2 . data ) ; return ; } } } } public static void Main ( String [ ] args ) { Node root1 = newNode ( 5 ) ; root1 . left = newNode ( 2 ) ; root1 . right = newNode ( 7 ) ; root1 . left . left = newNode ( 10 ) ; root1 . left . right = newNode ( 11 ) ; Node root2 = newNode ( 6 ) ; root2 . left = newNode ( 10 ) ; root2 . right = newNode ( 15 ) ; findFirstUnmatch ( root1 , root2 ) ; } }

Class/struct names: GfG, Node
C# program:
using System ; class GFG { static int intersection ( int n ) { return n * ( n - 1 ) ; } public static void Main ( ) { Console . WriteLine ( intersection ( 3 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int perimeter ( int diameter , int height ) { return 2 * ( diameter + height ) ; } public static void Main ( String [ ] args ) { int diameter = 5 ; int height = 10 ; Console . Write ( " Perimeter ▁ = ▁ " + perimeter ( diameter , height ) + " ▁ units STRNEWLINE " ) ; } }

Class/struct names: GFG