dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static int binaryToDecimal ( String n ) { String num = n ; int dec_value = 0 ; int base_ = 1 ; int len = num . Length ; for ( int i = len - 1 ; i >= 0 ; i -- ) { if ( num [ i ] == '1' ) dec_value += base_ ; base_ = base_ * 2 ; } return dec_value ; } static int numberSequence ( int n ) { if ( n == 1 ) return 1 ; String s = " " ; for ( int i = 1 ; i < n ; i ++ ) s += '1' ; s += '0' ; for ( int i = 1 ; i <= n ; i ++ ) s += '1' ; int num = binaryToDecimal ( s ) ; return num ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( numberSequence ( n ) ) ; } }

Index/key variables: i
Accumulator variables: dec_value, i, s
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int numberSequence ( int n ) { int num = ( int ) ( Math . Pow ( 4 , n ) - Math . Pow ( 2 , n ) ) - 1 ; return num ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( numberSequence ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int prime ( int num ) { int i , flag = 0 ; for ( i = 2 ; i <= num / 2 ; i ++ ) { if ( num % i == 0 ) { flag = 1 ; break ; } } if ( flag == 0 ) return 1 ; else return 0 ; } static void print_alternate_prime ( int n ) { int counter = 0 ; for ( int num = 2 ; num < n ; num ++ ) { if ( prime ( num ) == 1 ) { if ( counter % 2 == 0 ) Console . Write ( num + " ▁ " ) ; counter ++ ; } } } public static void Main ( ) { int n = 15 ; Console . Write ( " Following ▁ are ▁ the ▁ alternate ▁ " + " prime ▁ number ▁ smaller ▁ than ▁ " + " or ▁ equal ▁ to ▁ " + n + " STRNEWLINE " ) ; print_alternate_prime ( n ) ; } }

Accumulator variables: counter, i, num
Iterator variables: i, num
Class/struct names: GFG
C# program:
using System ; class GFG { static void SieveOfEratosthenes ( int n ) { bool [ ] prime = new bool [ n + 1 ] ; for ( int i = 0 ; i < prime . Length ; i ++ ) prime [ i ] = true ; for ( int p = 2 ; p * p <= n ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * 2 ; i <= n ; i += p ) prime [ i ] = false ; } } bool flag = true ; for ( int p = 2 ; p <= n ; p ++ ) { if ( prime [ p ] ) { if ( flag ) { Console . Write ( p + " ▁ " ) ; flag = false ; } else { flag = true ; } } } } public static void Main ( ) { int n = 15 ; Console . Write ( " Following ▁ are ▁ the ▁ alternate " + " ▁ prime ▁ numbers ▁ smaller ▁ " + " than ▁ or ▁ equal ▁ to ▁ " + n + " STRNEWLINE " ) ; SieveOfEratosthenes ( n ) ; } }

Index/key variables: i, p
Accumulator variables: i, p
Iterator variables: i, p
Boolean variables: flag
Class/struct names: GFG
C# program:
using System ; class GFG { static bool findGreater ( int x , int y ) { if ( x > y ) { return false ; } else { return true ; } } public static void Main ( ) { int x = 4 ; int y = 9 ; if ( findGreater ( x , y ) ) Console . WriteLine ( "1" ) ; else Console . WriteLine ( "2" ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int max_profit ( int [ ] a , int [ ] b , int n , int fee ) { int i , j , profit ; int l , r , diff_day = 1 , sum = 0 ; b [ 0 ] = 0 ; b [ 1 ] = diff_day ; for ( i = 1 ; i < n ; i ++ ) { l = 0 ; r = diff_day ; sum = 0 ; for ( j = n - 1 ; j >= i ; j -- ) { profit = ( a [ r ] - a [ l ] ) - fee ; if ( profit > 0 ) { sum = sum + profit ; } l ++ ; r ++ ; } if ( b [ 0 ] < sum ) { b [ 0 ] = sum ; b [ 1 ] = diff_day ; } diff_day ++ ; } return 0 ; } static public void Main ( ) { int [ ] arr = { 6 , 1 , 7 , 2 , 8 , 4 } ; int n = arr . Length ; int [ ] b = new int [ 2 ] ; int tranFee = 2 ; max_profit ( arr , b , n , tranFee ) ; Console . WriteLine ( b [ 0 ] + " , ▁ " + b [ 1 ] ) ; } }

Index/key variables: l, r
Accumulator variables: diff_day, i, j, l, r
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int binomialCoeff ( int x , int n , int k ) { int sum = 0 , term = 1 ; for ( int i = 1 ; i <= n && sum < k ; ++ i ) { term *= x - i + 1 ; term /= i ; sum += term ; } return sum ; } static int minTrials ( int n , int k ) { int low = 1 , high = k ; while ( low < high ) { int mid = ( low + high ) / 2 ; if ( binomialCoeff ( mid , n , k ) < k ) low = mid + 1 ; else high = mid ; } return low ; } public static void Main ( ) { Console . WriteLine ( minTrials ( 2 , 10 ) ) ; } }

Accumulator variables: sum, term
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Text ; using System . Collections ; class Geeks { static bool isPrime ( int num ) { if ( num < 2 num % 2 == 0 ) return num == 2 ; for ( int i = 3 ; i * i <= num ; i += 2 ) if ( num % i == 0 ) return false ; return true ; } static int primePalindrome ( int N ) { if ( 8 <= N && N <= 11 ) return 11 ; for ( int x = 1 ; x < 100000 ; ++ x ) { string s = x . ToString ( ) ; char [ ] buffer = s . ToCharArray ( ) ; Array . Reverse ( buffer ) ; int y = Int32 . Parse ( s + new string ( buffer ) . Substring ( 1 ) ) ; if ( y >= N && isPrime ( y ) == true ) return y ; } return - 1 ; } public static void Main ( ) { Console . WriteLine ( primePalindrome ( 112 ) ) ; } }

Accumulator variables: i
Iterator variables: i, x
Class/struct names: Geeks
C# program:
using System ; using System . Collections . Generic ; class GFG { static int getsum ( int a ) { int r = 0 , sum = 0 ; while ( a > 0 ) { r = a % 10 ; sum = sum + r ; a = a / 10 ; } return sum ; } static void value ( int a , int b , int c ) { int no , x = 0 , q = 0 , w = 0 ; List < int > v = new List < int > ( ) ; for ( int i = 1 ; i < 82 ; i ++ ) { no = ( int ) Math . Pow ( i , a ) ; no = b * no + c ; if ( no > 0 && no < 1000000000 ) { x = getsum ( no ) ; if ( x == i ) { q ++ ; v . Add ( no ) ; w ++ ; } } } for ( int i = 0 ; i < v . Count ; i ++ ) { Console . Write ( v [ i ] + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int a = 2 , b = 2 , c = - 1 ; value ( a , b , c ) ; } }

Index/key variables: i
Accumulator variables: i, q, w
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void print ( int p0 ) { int p1 , i = 0 , x , flag , k ; while ( true ) { flag = 1 ; x = ( int ) ( Math . Pow ( 2 , i ) ) ; p1 = x * p0 - ( x - 1 ) ; for ( k = 2 ; k < p1 ; k ++ ) { if ( p1 % k == 0 ) { flag = 0 ; break ; } } if ( flag == 0 ) break ; Console . Write ( p1 + " ▁ " ) ; i ++ ; } } static void Main ( ) { int p0 = 19 ; print ( p0 ) ; } }

Accumulator variables: i, k
Iterator variables: k
Class/struct names: GFG
C# program:
using System ; class GFG { public static int findOddPair ( int [ ] A , int N ) { int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( ( A [ i ] % 2 == 1 ) ) { count ++ ; } } return count * ( count - 1 ) / 2 ; } public static void Main ( string [ ] args ) { int [ ] a = new int [ ] { 5 , 1 , 3 , 2 } ; int n = a . Length ; Console . WriteLine ( findOddPair ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isSurd ( int n ) { for ( int i = 2 ; i * i <= n ; i ++ ) { int j = i ; while ( j < n ) j = j * i ; if ( j == n ) return false ; } return true ; } public static void Main ( ) { int n = 15 ; if ( isSurd ( n ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static long LastTwoDigit ( long num ) { long one = num % 10 ; num /= 10 ; long tens = num % 10 ; tens *= 10 ; num = tens + one ; return num ; } public static void Main ( String [ ] args ) { int n = 10 ; long num = 1 ; num = ( long ) Math . Pow ( 2 , n ) ; Console . WriteLine ( " Last ▁ 2 ▁ digits ▁ of ▁ 2 ^ 10 ▁ = ▁ " + LastTwoDigit ( num ) ) ; } }

Accumulator variables: num, tens
Class/struct names: GFG
C# program:
using System ; class GFG { static int power ( long x , long y , long p ) { while ( y > 0 ) { long r = y & 1 ; if ( r == 1 ) res = ( res * ( int ) x ) % ( int ) p ; x = ( x * x ) % p ; } return res ; } static int numberOfDigits ( int x ) { int i = 0 ; while ( x != 0 ) { x /= 10 ; i ++ ; } return i ; } static void LastTwoDigit ( int n ) { Console . Write ( " Last ▁ " + 2 + " ▁ digits ▁ of ▁ " + 2 + " ^ " ) ; Console . Write ( n + " ▁ = ▁ " ) ; int temp = 1 ; for ( int i = 1 ; i <= 2 ; i ++ ) temp *= 10 ; temp = power ( 2 , n , temp ) ; for ( int i = 0 ; i < ( 2 - numberOfDigits ( temp ) ) ; i ++ ) Console . Write ( 0 + " ▁ " ) ; if ( temp != 0 ) Console . Write ( temp ) ; } public static void Main ( ) { int n = 72 ; LastTwoDigit ( n ) ; } }

Accumulator variables: i, temp, x
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static long modPower ( long x , long y , long p ) { while ( y > 0 ) { if ( ( y & 1 ) > 0 ) res = ( res * x ) % p ; x = ( x * x ) % p ; } return res ; } static long gcd ( long a , long b ) { if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } static long gcdPow ( long a , long n , long c ) { if ( a % c == 0 ) return c ; long modexpo = modPower ( a , n , c ) ; return gcd ( modexpo , c ) ; } public static void Main ( ) { long a = 10248585 , n = 1000000 , c = 12564 ; Console . Write ( gcdPow ( a , n , c ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int countOddSum ( int [ ] ar , int n ) { int result = 0 ; for ( int i = 0 ; i <= n - 1 ; i ++ ) { int val = 0 ; for ( int j = i ; j <= n - 1 ; j ++ ) { val = val + ar [ j ] ; if ( val % 2 != 0 ) result ++ ; } } return ( result ) ; } public static void Main ( ) { int [ ] ar = { 5 , 4 , 4 , 5 , 1 , 3 } ; int n = ar . Length ; Console . Write ( " The ▁ Number ▁ of ▁ Subarrays " + " ▁ with ▁ odd ▁ sum ▁ is ▁ " ) ; Console . WriteLine ( countOddSum ( ar , n ) ) ; } }

Index/key variables: j
Accumulator variables: i, j, result
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int countOddSum ( int [ ] ar , int n ) { int [ ] temp = { 1 , 0 } ; int result = 0 , val = 0 ; for ( int i = 0 ; i <= n - 1 ; i ++ ) { val = ( ( val + ar [ i ] ) % 2 + 2 ) % 2 ; temp [ val ] ++ ; } result = temp [ 0 ] * temp [ 1 ] ; return ( result ) ; } public static void Main ( ) { int [ ] ar = { 5 , 4 , 4 , 5 , 1 , 3 } ; int n = ar . Length ; Console . Write ( " The ▁ Number ▁ of ▁ Subarrays " + " ▁ with ▁ odd ▁ sum ▁ is ▁ " + countOddSum ( ar , n ) ) ; } }

Index/key variables: i, val
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GEE { static void printPFsInPairs ( int n ) { for ( int i = 1 ; i * i <= n ; i ++ ) if ( n % i == 0 ) Console . Write ( i + " * " + n / i + " STRNEWLINE " ) ; } public static void Main ( ) { int n = 24 ; printPFsInPairs ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GEE
C# program:
using System ; class GFG { static int rangesum ( int n , int l , int r ) { int [ ] arr = new int [ n ] ; int c = 1 , i = 0 ; while ( c <= n ) { arr [ i ++ ] = c ; c += 2 ; } c = 2 ; while ( c <= n ) { arr [ i ++ ] = c ; c += 2 ; } int sum = 0 ; for ( i = l - 1 ; i < r ; i ++ ) { sum += arr [ i ] ; } return sum ; } public static void Main ( ) { int n = 12 ; int l = 1 , r = 11 ; Console . WriteLine ( rangesum ( n , l , r ) ) ; } }

Index/key variables: i, n
Accumulator variables: c, i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int sumeven ( int n , int l , int r ) { int sum = 0 ; int mid = n / 2 ; if ( r <= mid ) { int first = ( 2 * l - 1 ) ; int last = ( 2 * r - 1 ) ; int no_of_terms = r - l + 1 ; sum = ( ( no_of_terms ) * ( ( first + last ) ) ) / 2 ; } else if ( l >= mid ) { int first = ( 2 * ( l - n / 2 ) ) ; int last = ( 2 * ( r - n / 2 ) ) ; int no_of_terms = r - l + 1 ; sum = ( ( no_of_terms ) * ( ( first + last ) ) ) / 2 ; } else { int sumleft = 0 , sumright = 0 ; int first_term1 = ( 2 * l - 1 ) ; int last_term1 = ( 2 * ( n / 2 ) - 1 ) ; int no_of_terms1 = n / 2 - l + 1 ; sumleft = ( ( no_of_terms1 ) * ( ( first_term1 + last_term1 ) ) ) / 2 ; int first_term2 = 2 ; int last_term2 = ( 2 * ( r - n / 2 ) ) ; int no_of_terms2 = r - mid ; sumright = ( ( no_of_terms2 ) * ( ( first_term2 + last_term2 ) ) ) / 2 ; sum = ( sumleft + sumright ) ; } return sum ; } static int sumodd ( int n , int l , int r ) { int mid = n / 2 + 1 ; int sum = 0 ; if ( r <= mid ) { int first = ( 2 * l - 1 ) ; int last = ( 2 * r - 1 ) ; int no_of_terms = r - l + 1 ; sum = ( ( no_of_terms ) * ( ( first + last ) ) ) / 2 ; } else if ( l > mid ) { int first = ( 2 * ( l - mid ) ) ; int last = ( 2 * ( r - mid ) ) ; int no_of_terms = r - l + 1 ; sum = ( ( no_of_terms ) * ( ( first + last ) ) ) / 2 ; } else { int sumleft = 0 , sumright = 0 ; int first_term1 = ( 2 * l - 1 ) ; int last_term1 = ( 2 * mid - 1 ) ; int no_of_terms1 = mid - l + 1 ; sumleft = ( ( no_of_terms1 ) * ( ( first_term1 + last_term1 ) ) ) / 2 ; int first_term2 = 2 ; int last_term2 = ( 2 * ( r - mid ) ) ; int no_of_terms2 = r - mid ; sumright = ( ( no_of_terms2 ) * ( ( first_term2 + last_term2 ) ) ) / 2 ; sum = ( sumleft + sumright ) ; } return sum ; } static int rangesum ( int n , int l , int r ) { if ( n % 2 == 0 ) return sumeven ( n , l , r ) ; else return sumodd ( n , l , r ) ; } public static void Main ( ) { int n = 12 ; int l = 1 , r = 11 ; Console . WriteLine ( rangesum ( n , l , r ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void findAngle ( int n ) { int interiorAngle , exteriorAngle ; interiorAngle = ( n - 2 ) * 180 / n ; exteriorAngle = 360 / n ; Console . Write ( " Interior ▁ angle : ▁ " + interiorAngle + " STRNEWLINE " ) ; Console . Write ( " Exterior ▁ angle : ▁ " + exteriorAngle ) ; } public static void Main ( ) { int n = 10 ; findAngle ( n ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void distance ( float x1 , float y1 , float z1 , float x2 , float y2 , float z2 ) { double d = Math . Pow ( ( Math . Pow ( x2 - x1 , 2 ) + Math . Pow ( y2 - y1 , 2 ) + Math . Pow ( z2 - z1 , 2 ) * 1.0 ) , 0.5 ) ; Console . WriteLine ( " Distance ▁ is ▁ STRNEWLINE " + d ) ; return ; } public static void Main ( ) { float x1 = 2 ; float y1 = - 5 ; float z1 = 7 ; float x2 = 3 ; float y2 = 4 ; float z2 = 5 ; distance ( x1 , y1 , z1 , x2 , y2 , z2 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool DivisibleBy41 ( int first , int second , int c , int n ) { int [ ] digit = new int [ n ] ; digit [ 0 ] = first ; digit [ 1 ] = second ; for ( int i = 2 ; i < n ; i ++ ) digit [ i ] = ( digit [ i - 1 ] * c + digit [ i - 2 ] ) % 10 ; int ans = digit [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) ans = ( ans * 10 + digit [ i ] ) % 41 ; if ( ans % 41 == 0 ) return true ; else return false ; } public static void Main ( ) { int first = 1 , second = 2 , c = 1 , n = 3 ; if ( DivisibleBy41 ( first , second , c , n ) ) Console . Write ( " YES " ) ; else Console . Write ( " NO " ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int findTetrahedralNumber ( int n ) { return ( ( n * ( n + 1 ) * ( n + 2 ) ) / 6 ) ; } static void printSeries ( int n ) { int prev = 0 ; int curr ; for ( int i = 1 ; i <= n ; i ++ ) { curr = findTetrahedralNumber ( i ) ; curr = curr + prev ; Console . Write ( curr + " ▁ " ) ; prev = curr ; } } static public void Main ( ) { int n = 10 ; printSeries ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static void printSeries ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) { int num = ( i * ( i + 1 ) * ( i + 2 ) * ( i + 3 ) / 24 ) ; Console . Write ( num + " ▁ " ) ; } } static public void Main ( ) { int n = 10 ; printSeries ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int No_Of_Pairs ( int N ) { int i = 1 ; while ( ( i * i * i ) + ( 2 * i * i ) + i <= N ) i ++ ; return ( i - 1 ) ; } static void print_pairs ( int pairs ) { int i = 1 , mul ; for ( i = 1 ; i <= pairs ; i ++ ) { mul = i * ( i + 1 ) ; Console . WriteLine ( " Pair ▁ no . ▁ " + i + " ▁ - - > ▁ ( " + ( mul * i ) + " , ▁ " + mul * ( i + 1 ) + " ) " ) ; } } static void Main ( ) { int N = 500 , pairs ; pairs = No_Of_Pairs ( N ) ; Console . WriteLine ( " No . ▁ of ▁ pairs ▁ = ▁ " + pairs ) ; print_pairs ( pairs ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static long findTriangularNumber ( int n ) { return ( n * ( n + 1 ) ) / 2 ; } static void printSeries ( int n ) { long prev = 0 ; long curr ; for ( int i = 1 ; i <= n ; i ++ ) { curr = findTriangularNumber ( i ) ; curr = curr + prev ; Console . Write ( curr + " ▁ " ) ; prev = curr ; } } static public void Main ( ) { int n = 10 ; printSeries ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static void printSeries ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) { int num = i * ( i + 1 ) * ( i + 2 ) / 6 ; Console . Write ( num + " ▁ " ) ; } } static public void Main ( ) { int n = 10 ; printSeries ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void count_even_odd ( int min , int max , int [ , ] steps ) { int a , b , even , odd ; bool beven = true , aeven = false ; int n = 2 ; for ( int i = 0 ; i < n ; i ++ ) { a = steps [ i , 0 ] ; b = steps [ i , 1 ] ; if ( ! ( aeven || ( a & 1 ) > 0 ) ) aeven = true ; if ( beven ) { if ( ( b & 1 ) > 0 ) beven = false ; } else if ( ! ( ( a & 1 ) > 0 ) ) { if ( ! ( ( b & 1 ) > 0 ) ) beven = true ; } else { if ( ( b & 1 ) > 0 ) beven = true ; } } if ( beven ) { even = ( int ) max / 2 - ( int ) ( min - 1 ) / 2 ; odd = 0 ; } else { even = ( int ) max / 2 - ( int ) ( min - 1 ) / 2 ; odd = 0 ; } if ( ! ( beven ^ aeven ) ) even += max - min + 1 - ( int ) max / 2 + ( int ) ( min - 1 ) / 2 ; else odd += max - min + 1 - ( int ) max / 2 + ( int ) ( min - 1 ) / 2 ; Console . Write ( " even ▁ = ▁ " + even + " , ▁ odd ▁ = ▁ " + odd ) ; } public static void Main ( ) { int min = 1 , max = 4 ; int [ , ] steps = { { 1 , 2 } , { 3 , 4 } } ; count_even_odd ( min , max , steps ) ; } }

Accumulator variables: even, i, odd
Iterator variables: i
Boolean variables: aeven, beven
Class/struct names: GFG
C# program:
using System ; class GFG { static int getMaxOnes ( int n , int x ) { int zeroes = ( n / x ) ; zeroes = zeroes * zeroes ; int total = n * n ; int ans = total - zeroes ; return ans ; } static public void Main ( ) { int n = 5 ; int x = 2 ; Console . WriteLine ( getMaxOnes ( n , x ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class geeks { public static int minimumOperations ( int [ ] a , int n ) { Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( mp . ContainsKey ( a [ i ] ) ) { var val = mp [ a [ i ] ] ; mp . Remove ( a [ i ] ) ; mp . Add ( a [ i ] , val + 1 ) ; } else { mp . Add ( a [ i ] , 1 ) ; } } int count = 0 ; foreach ( KeyValuePair < int , int > entry in mp ) { if ( entry . Value > 1 ) { count += ( entry . Value - 1 ) ; } } return count ; } public static void Main ( String [ ] args ) { int [ ] a = { 2 , 1 , 2 , 3 , 3 , 4 , 3 } ; int n = a . Length ; Console . WriteLine ( minimumOperations ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: entry, i
Class/struct names: geeks
C# program:
using System ; class GFG { static void check ( int n , int m ) { if ( n == 2 m == 2 n % m == 0 ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } public static void Main ( ) { int m = 3 , n = 9 ; check ( n , m ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void findSurfaceArea ( float a , float h ) { float Area ; Area = 6 * a * h + 3 * ( float ) ( Math . Sqrt ( 3 ) ) * a * a ; Console . WriteLine ( " Surface ▁ Area : ▁ " + Area ) ; } static void findVolume ( float a , float h ) { float Volume ; Volume = 3 * ( float ) ( Math . Sqrt ( 3 ) ) * a * a * h / 2 ; Console . WriteLine ( " Volume : ▁ " + Volume ) ; } public static void Main ( ) { float a = 5 , h = 10 ; findSurfaceArea ( a , h ) ; findVolume ( a , h ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double MinimumMail ( int n , int k , int x ) { double m = ( n - 1 ) + Math . Ceiling ( ( n - 1 ) * 1.0 / x ) * ( n - 1 ) + Math . Ceiling ( n * 1.0 / x ) * ( k - n ) ; return m ; } public static void Main ( ) { int N = 4 ; int K = 9 ; int X = 2 ; Console . WriteLine ( ( int ) MinimumMail ( N , K , X ) + " STRNEWLINE " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void findArea ( float a , float b ) { float Area ; Area = ( float ) 3.142 * a * b ; Console . WriteLine ( " Area : ▁ " + Area ) ; } public static void Main ( ) { float a = 5 , b = 4 ; findArea ( a , b ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int calculate ( int x , int k , int m ) { int result = x ; k -- ; while ( k -- > 0 ) { result = ( int ) Math . Pow ( result , x ) ; if ( result > m ) result %= m ; } return result ; } static public void Main ( ) { int x = 5 , k = 2 , m = 3 ; Console . WriteLine ( calculate ( x , k , m ) ) ; } }

Accumulator variables: k
Class/struct names: GFG
C# program:
using System ; class GFG { static int rev ( int n , int temp ) { if ( n == 0 ) return temp ; temp = ( temp * 10 ) + ( n % 10 ) ; return rev ( n / 10 , temp ) ; } public static void Main ( ) { int n = 121 ; int temp = rev ( n , 0 ) ; if ( temp == n ) Console . WriteLine ( " yes " ) ; else Console . WriteLine ( " no " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void findGreater ( int a , int b , int n ) { if ( ! ( ( n & 1 ) > 0 ) ) { a = Math . Abs ( a ) ; b = Math . Abs ( b ) ; } if ( a == b ) Console . WriteLine ( " a ^ n ▁ is ▁ " + " equal ▁ to ▁ b ^ n " ) ; else if ( a > b ) Console . WriteLine ( " a ^ n ▁ is ▁ greater ▁ " + " than ▁ b ^ n " ) ; else Console . WriteLine ( " b ^ n ▁ is ▁ greater ▁ " + " than ▁ a ^ n " ) ; } public static void Main ( ) { int a = 12 , b = 24 , n = 5 ; findGreater ( a , b , n ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static void fibonacci ( double n ) { double fib ; for ( double i = 0 ; i < n ; i ++ ) { fib = ( Math . Pow ( ( 1 + Math . Sqrt ( 5 ) ) , i ) - Math . Pow ( ( 1 - Math . Sqrt ( 5 ) ) , i ) ) / ( Math . Pow ( 2 , i ) * Math . Sqrt ( 5 ) ) ; Console . Write ( ( int ) fib + " ▁ " ) ; } } static public void Main ( ) { double n = 8 ; fibonacci ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int center_hexadecagonal_num ( int n ) { return 8 * n * n - 8 * n + 1 ; } static public void Main ( ) { int n = 2 ; Console . Write ( n + " th ▁ centered ▁ " + " hexadecagonal ▁ number : ▁ " ) ; Console . WriteLine ( center_hexadecagonal_num ( n ) ) ; n = 12 ; Console . Write ( n + " th ▁ centered ▁ " + " hexadecagonal ▁ number : ▁ " ) ; Console . WriteLine ( center_hexadecagonal_num ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static int findNature ( int a , int b , int n ) { int [ ] seq = new int [ 100 ] ; seq [ 0 ] = a ; seq [ 1 ] = b ; for ( int i = 2 ; i <= n ; i ++ ) seq [ i ] = seq [ i - 1 ] + seq [ i - 2 ] ; if ( ( seq [ n ] & 1 ) != 0 ) return 1 ; else return 0 ; } public static void Main ( ) { int a = 2 , b = 4 ; int n = 3 ; if ( findNature ( a , b , n ) == 1 ) Console . Write ( " Odd ▁ " ) ; else Console . Write ( " Even ▁ " ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void check ( ulong m , ulong n ) { double RHS = m * ( double ) Math . Log ( n ) ; double LHS = n * ( double ) Math . Log ( m ) ; if ( LHS > RHS ) Console . Write ( " m ^ n ▁ > ▁ n ^ m " ) ; else if ( LHS < RHS ) Console . Write ( " m ^ n ▁ < ▁ n ^ m " ) ; else Console . Write ( " m ^ n ▁ = ▁ n ^ m " ) ; } static public void Main ( ) { ulong m = 987654321 , n = 123456987 ; check ( m , n ) ; } }

Class/struct names: GFG