dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { public static int longestMountain ( int [ ] a ) { int i = 0 , j = - 1 , k = - 1 , p = 0 , d = 0 ; if ( a . Length < 3 ) return 0 ; for ( i = 0 ; i < a . Length - 1 ; i ++ ) { if ( a [ i + 1 ] > a [ i ] ) { if ( k != - 1 ) { k = - 1 ; j = - 1 ; } if ( j == - 1 ) j = i ; } else { if ( a [ i + 1 ] < a [ i ] ) { if ( j != - 1 ) k = i + 1 ; if ( k != - 1 && j != - 1 ) { if ( d < k - j + 1 ) d = k - j + 1 ; } } else { k = - 1 ; j = - 1 ; } } } if ( k != - 1 && j != - 1 ) { if ( d < k - j + 1 ) d = k - j + 1 ; } return d ; } public static void Main ( String [ ] args ) { int [ ] a = { 1 , 3 , 1 , 4 , 5 , 6 , 7 , 8 , 9 , 8 , 7 , 6 , 5 } ; Console . WriteLine ( longestMountain ( a ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static string solve ( int [ ] A ) { int i , ctr = 0 ; for ( i = 0 ; i < A . Length ; i ++ ) { if ( A [ i ] % 2 == 1 ) { ctr ++ ; } } if ( ctr % 2 == 1 ) { return " No " ; } else { return " Yes " ; } } public static void Main ( ) { int [ ] arr = { 9 , 17 } ; Console . Write ( solve ( arr ) ) ; } }

Index/key variables: i
Accumulator variables: ctr, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPerfectSquare ( double x ) { double sr = Math . Sqrt ( x ) ; return ( ( sr - Math . Floor ( sr ) ) == 0 ) ; } static int countSquares ( int n ) { int cnt = 0 ; for ( int i = ( int ) Math . Pow ( 10 , ( n - 1 ) ) ; i < Math . Pow ( 10 , n ) ; i ++ ) { if ( i != 0 && isPerfectSquare ( i ) ) cnt ++ ; } return cnt ; } public static void Main ( String [ ] args ) { int n = 3 ; Console . Write ( countSquares ( n ) ) ; } }

Accumulator variables: cnt, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countSquares ( int n ) { int r = ( int ) Math . Ceiling ( Math . Sqrt ( Math . Pow ( 10 , n ) ) ) ; int l = ( int ) Math . Ceiling ( Math . Sqrt ( Math . Pow ( 10 , n - 1 ) ) ) ; return r - l ; } public static void Main ( ) { int n = 3 ; Console . Write ( countSquares ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int summation ( int N ) { int co = ( N + 1 ) / 2 ; int ce = ( N ) / 2 ; int se = 2 * ( ( ce * ( ce + 1 ) ) * ( ce * ( ce + 1 ) ) ) ; int so = ( co * co ) * ( 2 * ( ( co * co ) ) - 1 ) ; return so - se ; } public static void Main ( String [ ] args ) { int n = 3 ; Console . WriteLine ( summation ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isStar ( int N ) { double n = ( 6 + Math . Sqrt ( 24 * N + 12 ) ) / 6 ; return ( n - ( int ) n ) == 0 ; } public static void Main ( ) { int i = 13 ; if ( isStar ( i ) ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int findMinDivisor ( int [ ] arr , int n , int limit ) { int low = 0 , high = 1000000000 ; while ( low < high ) { int mid = ( low + high ) / 2 ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { sum += ( int ) Math . Ceiling ( ( double ) arr [ i ] / ( double ) mid ) ; } if ( sum <= limit ) { high = mid ; } else { low = mid + 1 ; } } return low ; } public static void Main ( String [ ] args ) { int [ ] arr = { 2 , 3 , 4 , 9 } ; int N = arr . Length ; int K = 6 ; Console . WriteLine ( findMinDivisor ( arr , N , K ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static int getCount ( int [ ] arr , int n ) { int count = 0 ; for ( int j = 1 ; j < n - 1 ; j ++ ) { int p = 0 , q = 0 ; for ( int i = 0 ; i < j ; i ++ ) { if ( arr [ j ] % arr [ i ] == 0 ) p ++ ; } for ( int k = j + 1 ; k < n ; k ++ ) { if ( arr [ k ] % arr [ j ] == 0 ) q ++ ; } count += p * q ; } return count ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 2 } ; int N = arr . Length ; Console . WriteLine ( getCount ( arr , N ) ) ; } }

Index/key variables: i, j, k
Accumulator variables: count, i, j, k, p, q
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static float computeMaxValue ( float [ ] arr , int n ) { float ans = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { float val = Math . Max ( arr [ i ] / arr [ j ] , arr [ j ] / arr [ i ] ) ; ans = Math . Max ( ans , val ) ; } } return ans ; } public static void Main ( String [ ] args ) { float [ ] arr = { 15 , 10 , 3 , 2 } ; int N = arr . Length ; Console . WriteLine ( computeMaxValue ( arr , N ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int kthNonDivisible ( int N , int K ) { return ( int ) ( K + Math . Floor ( ( double ) ( K - 1 ) / ( N - 1 ) ) ) ; } public static void Main ( String [ ] args ) { int N = 3 ; int K = 6 ; Console . Write ( kthNonDivisible ( N , K ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int sz = ( int ) 1e3 ; static bool isEvenParity ( int x ) { int parity = 0 ; while ( x != 0 ) { if ( x % 2 == 1 ) parity ++ ; x = x >> 1 ; } if ( parity % 2 == 0 ) return true ; else return false ; } static void printArray ( int [ ] arr , int len ) { for ( int i = 0 ; i < len ; i ++ ) { Console . Write ( arr [ i ] + " ▁ " ) ; } } static void findPairEvenParity ( int [ ] arr , int len ) { int firstMaximum = Int32 . MinValue ; int secondMaximum = Int32 . MinValue ; for ( int i = 0 ; i < len ; i ++ ) { if ( isEvenParity ( arr [ i ] ) ) { if ( arr [ i ] >= firstMaximum ) { secondMaximum = firstMaximum ; firstMaximum = arr [ i ] ; } else if ( arr [ i ] >= secondMaximum ) { secondMaximum = arr [ i ] ; } } } Console . Write ( firstMaximum + " ▁ " + secondMaximum ) ; } public static void Main ( ) { int [ ] arr = { 18 , 15 , 8 , 9 , 14 } ; int len = arr . Length ; findPairEvenParity ( arr , len ) ; } }

Index/key variables: i
Accumulator variables: i, parity
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isHexagonal ( int N ) { float val = 8 * N + 1 ; float x = 1 + ( float ) Math . Sqrt ( val ) ; float n = ( x ) / 4 ; if ( ( n - ( int ) n ) == 0 ) { return true ; } else { return false ; } } public static void Main ( string [ ] args ) { int N = 14 ; if ( isHexagonal ( N ) == true ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void NumbertoCharacter ( int n ) { int rev = 0 , r = 0 ; while ( n > 0 ) { r = n % 10 ; rev = rev * 10 + r ; n = n / 10 ; } while ( rev > 0 ) { r = rev % 10 ; switch ( r ) { case 1 : Console . Write ( " one ▁ " ) ; break ; case 2 : Console . Write ( " two ▁ " ) ; break ; case 3 : Console . Write ( " three ▁ " ) ; break ; case 4 : Console . Write ( " four ▁ " ) ; break ; case 5 : Console . Write ( " five ▁ " ) ; break ; case 6 : Console . Write ( " six ▁ " ) ; break ; case 7 : Console . Write ( " seven ▁ " ) ; break ; case 8 : Console . Write ( " eight ▁ " ) ; break ; case 9 : Console . Write ( " nine ▁ " ) ; break ; case 0 : Console . Write ( " zero ▁ " ) ; break ; default : Console . Write ( " UnValid ▁ " ) ; break ; } rev = rev / 10 ; } } public static void Main ( String [ ] args ) { int n = 12345 ; NumbertoCharacter ( n ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int Solve ( int [ ] arr , int n ) { int temp = 0 , count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { temp = 0 ; for ( int j = i ; j < n ; j ++ ) { temp += arr [ j ] ; if ( ( temp + 2 ) % 4 != 0 ) count ++ ; } } return count ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 } ; int N = arr . Length ; Console . Write ( Solve ( arr , N ) ) ; } }

Index/key variables: j
Accumulator variables: count, i, j, temp
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int m = 4 ; static long power ( long x , long y , long p ) { long res = 1 ; x = x % p ; while ( y > 0 ) { if ( y % 2 == 1 ) res = ( res * x ) % p ; y = y >> 1 ; x = ( x * x ) % p ; } return res ; } static void nCr ( int n , long p , int [ , ] f ) { for ( int i = 0 ; i <= n ; i ++ ) { for ( int j = 0 ; j <= m ; j ++ ) { if ( j > i ) f [ i , j ] = 0 ; else if ( j == 0 j == i ) f [ i , j ] = 1 ; else f [ i , j ] = ( f [ i - 1 , j ] + f [ i - 1 , j - 1 ] ) % ( int ) p ; } } } static void operations ( int [ ] arr , int n , int [ , ] f ) { long p = 1000000007 ; nCr ( n , p - 1 , f ) ; Array . Sort ( arr ) ; long ans = 1 ; for ( int i = 0 ; i < n ; i ++ ) { long x = 0 ; for ( int j = 1 ; j <= m ; j ++ ) { if ( m % j == 0 ) x = ( x + ( f [ n - i - 1 , m - j ] * f [ i , j - 1 ] ) % ( p - 1 ) ) % ( p - 1 ) ; } ans = ( ( ans * power ( arr [ i ] , x , p ) ) % p ) ; } Console . Write ( ans + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 4 , 5 , 7 , 9 , 3 } ; int n = arr . Length ; int [ , ] f = new int [ n + 1 , m + 1 ] ; operations ( arr , n , f ) ; } }

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

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool prodSquare ( int n ) { Dictionary < float , float > s = new Dictionary < float , float > ( ) ; for ( int i = 2 ; i * i <= n ; ++ i ) { s . Add ( ( float ) ( i * i ) , ( float ) 1 ) ; if ( s . ContainsKey ( ( float ) n / ( i * i ) ) ) return true ; } return false ; } public static void Main ( String [ ] args ) { int n = 25 ; if ( prodSquare ( n ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static void printArr ( int n ) { if ( n % 4 == 0 ) { for ( int i = 1 ; i <= n / 2 ; i ++ ) Console . Write ( i * 2 + " ▁ " ) ; for ( int i = 1 ; i < n / 2 ; i ++ ) Console . Write ( i * 2 - 1 + " ▁ " ) ; Console . WriteLine ( n + n / 2 - 1 ) ; } else Console . Write ( " - 1" ) ; } public static void Main ( String [ ] args ) { int n = 22 ; printArr ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int GetSum ( int n ) { List < int > divisors = new List < int > ( ) ; for ( int i = 1 ; i * i <= n ; i ++ ) { if ( n % i == 0 ) { divisors . Add ( i ) ; if ( i != n / i ) { divisors . Add ( n / i ) ; } } } int ans = 1 ; foreach ( int i in divisors ) { ans *= ( i + 1 ) ; } ans = ans - 1 ; return ans ; } public static void Main ( ) { int N = 4 ; Console . WriteLine ( GetSum ( N ) ) ; } }

Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPowerful ( int n ) { while ( n % 2 == 0 ) { int power = 0 ; while ( n % 2 == 0 ) { n /= 2 ; power ++ ; } if ( power == 1 ) return false ; } for ( int factor = 3 ; factor <= Math . Sqrt ( n ) ; factor += 2 ) { int power = 0 ; while ( n % factor == 0 ) { n = n / factor ; power ++ ; } if ( power == 1 ) return false ; } return ( n == 1 ) ; } static int longestPowerfulSubsequence ( int [ ] arr , int n ) { int answer = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( isPowerful ( arr [ i ] ) ) answer ++ ; } return answer ; } public static void Main ( String [ ] args ) { int [ ] arr = { 6 , 4 , 10 , 13 , 9 , 25 } ; int n = arr . Length ; Console . Write ( longestPowerfulSubsequence ( arr , n ) + " STRNEWLINE " ) ; } }

Index/key variables: i
Accumulator variables: answer, factor, i, n, power
Iterator variables: factor, i
Class/struct names: GFG
C# program:
using System ; using System . Linq ; class GFG { static int maxOR ( int [ ] arr , int n ) { int max_value = arr . Max ( ) ; int number_of_bits = ( int ) ( Math . Log ( max_value ) ) + 2 ; int complement = ( ( 1 << number_of_bits ) - 1 ) ^ max_value ; int c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] != max_value ) { c = Math . Max ( c , ( complement & arr [ i ] ) ) ; } } return ( max_value + c ) ; } public static void Main ( ) { int [ ] arr = { 3 , 6 , 8 , 16 } ; int n = arr . Length ; Console . Write ( maxOR ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void update ( int [ ] res , int L , int R , int K ) { L -= 1 ; R -= 1 ; res [ L ] ^= K ; res [ R + 1 ] ^= K ; } static void display ( int [ ] arr , int [ ] res , int n ) { int i ; for ( i = 1 ; i < n ; i ++ ) { res [ i ] = res [ i ] ^ res [ i - 1 ] ; } for ( i = 0 ; i < n ; i ++ ) { Console . Write ( ( arr [ i ] ^ res [ i ] ) + " ▁ " ) ; } Console . WriteLine ( ) ; } public static void Main ( ) { int [ ] arr = { 2 , 4 , 6 , 8 , 10 } ; int N = arr . Length ; int [ ] res = new int [ N ] ; int L = 1 , R = 3 , K = 2 ; update ( res , L , R , K ) ; L = 2 ; R = 4 ; K = 3 ; update ( res , L , R , K ) ; display ( arr , res , N ) ; } }

Index/key variables: L, N, i
Accumulator variables: L, R, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool check ( int [ ] a , int n , int k ) { Dictionary < int , int > m = new Dictionary < int , int > ( ) ; int extra = 0 ; for ( int i = k ; i < n ; i ++ ) if ( m . ContainsKey ( a [ i ] ) ) m [ a [ i ] ] = m [ a [ i ] ] + 1 ; else m . Add ( a [ i ] , 1 ) ; foreach ( int x in m . Keys ) extra += m [ x ] - 1 ; if ( extra == 0 ) return true ; for ( int i = 1 ; i + k - 1 < n ; i ++ ) { if ( m [ a [ i + k - 1 ] ] > 1 ) extra -- ; m [ a [ i + k - 1 ] ] = m [ a [ i + k - 1 ] ] - 1 ; m [ a [ i - 1 ] ] = m [ a [ i - 1 ] ] + 1 ; if ( m [ a [ i - 1 ] ] > 1 ) extra ++ ; if ( extra == 0 ) return true ; } return false ; } static int minlength ( int [ ] a , int n ) { int lo = 0 , hi = n + 1 ; int ans = 0 ; while ( lo < hi ) { int mid = ( lo + hi ) / 2 ; if ( check ( a , n , mid ) ) { ans = mid ; hi = mid ; } else lo = mid + 1 ; } return ans ; } public static void Main ( String [ ] args ) { int [ ] a = { 1 , 2 , 1 , 2 , 3 } ; int n = a . Length ; Console . WriteLine ( minlength ( a , n ) ) ; } }

Index/key variables: i, x
Accumulator variables: extra, i
Iterator variables: i, x
Class/struct names: GFG
C# program:
using System ; class GFG { static void findNumbers ( int N ) { for ( int i = 1 ; i <= ( N / 2 ) ; i ++ ) { Console . Write ( i + " , ▁ " + - i + " , ▁ " ) ; } if ( N % 2 == 1 ) Console . Write ( 0 ) ; } static void Main ( ) { int N = 10 ; findNumbers ( N ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class ComputeElectricityBill { public static int calculateBill ( int units ) { if ( units <= 100 ) { return units * 10 ; } else if ( units <= 200 ) { return ( 100 * 10 ) + ( units - 100 ) * 15 ; } else if ( units <= 300 ) { return ( 100 * 10 ) + ( 100 * 15 ) + ( units - 200 ) * 20 ; } else if ( units > 300 ) { return ( 100 * 10 ) + ( 100 * 15 ) + ( 100 * 20 ) + ( units - 300 ) * 25 ; } return 0 ; } public static void Main ( String [ ] args ) { int units = 250 ; Console . WriteLine ( calculateBill ( units ) ) ; } }

Class/struct names: ComputeElectricityBill
C# program:
using System ; class GFG { static int countPrimeFactors ( int n ) { if ( n == 1 ) return 0 ; int cnt = 0 ; while ( n % 2 == 0 ) { cnt ++ ; n = n / 2 ; } for ( int i = 3 ; i <= Math . Sqrt ( n ) ; i += 2 ) { while ( n % i == 0 ) { cnt ++ ; n = n / i ; } } if ( n > 2 ) cnt ++ ; return cnt ; } static public void Main ( ) { int x = 8 ; int prime_factor_cnt = countPrimeFactors ( x ) ; Console . Write ( prime_factor_cnt ) ; } }

Accumulator variables: cnt, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countPalindromic ( int n ) { int count ; if ( n % 2 == 1 ) { count = ( int ) Math . Pow ( 9 , ( n - 1 ) / 2 ) ; } else { count = ( int ) Math . Pow ( 9 , ( n - 2 ) / 2 ) ; } return count ; } public static void Main ( ) { int n = 3 ; Console . Write ( countPalindromic ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int countSubArrayWithOddProduct ( int [ ] A , int N ) { int count = 0 ; int last = - 1 ; int K = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( A [ i ] % 2 == 0 ) { K = ( i - last - 1 ) ; count += ( K * ( K + 1 ) / 2 ) ; last = i ; } } K = ( N - last - 1 ) ; count += ( K * ( K + 1 ) / 2 ) ; return count ; } static void Main ( ) { int [ ] arr = { 12 , 15 , 7 , 3 , 25 , 6 , 2 , 1 , 1 , 7 } ; int n = arr . Length ; Console . WriteLine ( countSubArrayWithOddProduct ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static double CgpaCalc ( double [ ] marks , int n ) { double [ ] grade = new double [ n ] ; double cgpa , sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { grade [ i ] = ( marks [ i ] / 10 ) ; } for ( int i = 0 ; i < n ; i ++ ) { sum += grade [ i ] ; } cgpa = sum / n ; return cgpa ; } public static void Main ( String [ ] args ) { int n = 5 ; double [ ] marks = { 90 , 80 , 70 , 80 , 90 } ; double cgpa = CgpaCalc ( marks , n ) ; Console . WriteLine ( " CGPA ▁ = ▁ " + cgpa ) ; Console . WriteLine ( " CGPA ▁ Percentage ▁ = ▁ { 0 : F2 } " , cgpa * 9.5 ) ; } }

Index/key variables: i, n
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findMinXORSubarray ( int [ ] arr , int n , int k ) { if ( n < k ) return ; int res_index = 0 ; int curr_xor = 0 ; for ( int i = 0 ; i < k ; i ++ ) curr_xor ^= arr [ i ] ; int min_xor = curr_xor ; for ( int i = k ; i < n ; i ++ ) { curr_xor ^= ( arr [ i ] ^ arr [ i - k ] ) ; if ( curr_xor < min_xor ) { min_xor = curr_xor ; res_index = ( i - k + 1 ) ; } } Console . Write ( min_xor + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 3 , 7 , 90 , 20 , 10 , 50 , 40 } ; int k = 3 ; int n = arr . Length ; findMinXORSubarray ( arr , n , k ) ; } }

Index/key variables: i
Accumulator variables: curr_xor, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static String getNumber ( int a , int b ) { String X = a . ToString ( ) ; String Y = b . ToString ( ) ; String XY = X + Y ; String YX = Y + X ; return XY . CompareTo ( YX ) > 0 ? XY : YX ; } static void printMaxPair ( int [ ] arr , int n ) { int largest = int . MinValue ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = i + 1 ; j < n ; j ++ ) { int number = Int32 . Parse ( getNumber ( arr [ i ] , arr [ j ] ) ) ; largest = Math . Max ( largest , number ) ; } Console . WriteLine ( largest ) ; } public static void Main ( String [ ] args ) { int [ ] a = { 23 , 14 , 16 , 25 , 3 , 9 } ; int n = a . Length ; printMaxPair ( a , n ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool checkGoldenRatio ( float a , float b ) { if ( a <= b ) { float temp = a ; a = b ; b = temp ; } string ratio1 = String . Format ( " { 0:0.000 } " , a / b ) ; string ratio2 = String . Format ( " { 0:0.000 } " , ( a + b ) / a ) ; if ( ratio1 == ratio2 && ratio1 == "1.618" ) { Console . WriteLine ( " Yes " ) ; return true ; } else { Console . WriteLine ( " No " ) ; return false ; } } static void Main ( ) { float a = ( float ) 0.618 ; float b = 1 ; checkGoldenRatio ( a , b ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int minNum ( int n , int k ) { int x = ( int ) ( Math . Log ( n ) / Math . Log ( k ) ) + 1 ; int mn = ( int ) ( Math . Pow ( k , x ) - n ) ; return mn ; } public static void Main ( string [ ] args ) { int n = 20 , k = 5 ; Console . Write ( minNum ( n , k ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int previousPerfectSquare ( int N ) { int prevN = ( int ) Math . Floor ( Math . Sqrt ( N ) ) ; if ( prevN * prevN == N ) prevN -= 1 ; return prevN * prevN ; } static int previousPerfectCube ( int N ) { int prevN = ( int ) Math . Floor ( Math . Cbrt ( N ) ) ; if ( prevN * prevN * prevN == N ) prevN -= 1 ; return prevN * prevN * prevN ; } public static void Main ( String [ ] args ) { int n = 30 ; Console . WriteLine ( previousPerfectSquare ( n ) ) ; Console . WriteLine ( previousPerfectCube ( n ) ) ; } }

Accumulator variables: prevN
Class/struct names: GFG
C# program:
using System ; class GFG { static int findCount ( int [ ] arr , int n ) { int res = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) for ( int j = i + 1 ; j < n ; j ++ ) if ( ( arr [ i ] % 2 == 0 ) && ( arr [ j ] % 2 == 1 ) ) { res ++ ; } return res ; } public static void Main ( String [ ] args ) { int [ ] a = { 5 , 4 , 1 , 2 , 3 } ; int n = a . Length ; Console . Write ( findCount ( a , n ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, res
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int findCount ( int [ ] arr , int n ) { int count = 0 , ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] % 2 == 0 ) { count ++ ; } else { ans = ans + count ; } } return ans ; } public static void Main ( ) { int [ ] a = { 5 , 4 , 1 , 2 , 3 } ; int n = a . Length ; Console . WriteLine ( findCount ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { private static long product ( int [ ] arr ) { double occurrence = Math . Pow ( 2 , arr . Length - 1 ) ; double product = 1 ; for ( int i = 0 ; i < arr . Length ; i ++ ) { product *= Math . Pow ( arr [ i ] , occurrence ) ; } return ( long ) product ; } public static void Main ( String [ ] args ) { int [ ] arr = { 10 , 3 , 7 } ; Console . WriteLine ( product ( arr ) ) ; } }

Index/key variables: i
Accumulator variables: i, product
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MOD = 1000000007 ; static int power ( int a , int b ) { if ( b == 0 ) return 1 ; int temp = power ( a , b / 2 ) ; temp = ( temp * temp ) % MOD ; if ( b % 2 != 0 ) { temp = ( temp * a ) % MOD ; } return temp ; } static void palindromicSum ( int N ) { int sum = 0 , res , ways ; if ( N == 1 ) { Console . Write ( "9" + " STRNEWLINE " ) ; return ; } if ( N == 2 ) { Console . Write ( "99" + " STRNEWLINE " ) ; return ; } ways = N / 2 ; if ( N % 2 == 0 ) ways -- ; res = power ( 9 , ways - 1 ) ; for ( int i = 0 ; i < N ; i ++ ) { sum = sum * 10 + 45 * res ; sum %= MOD ; } Console . Write ( sum + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { int N = 3 ; palindromicSum ( N ) ; } }

Accumulator variables: i, ways
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int joinNumbers ( int numA , int numB ) { int revB = 0 ; while ( numB > 0 ) { revB = revB * 10 + ( numB % 10 ) ; numB = numB / 10 ; } while ( revB > 0 ) { numA = numA * 10 + ( revB % 10 ) ; revB = revB / 10 ; } return numA ; } static int findMaxSum ( int [ ] A , int [ ] B , int n ) { int [ ] maxArr = new int [ n ] ; for ( int i = 0 ; i < n ; ++ i ) { int X = joinNumbers ( A [ i ] , B [ i ] ) ; int Y = joinNumbers ( B [ i ] , A [ i ] ) ; int mx = Math . Max ( X , Y ) ; maxArr [ i ] = mx ; } int maxAns = 0 ; for ( int i = 0 ; i < n ; i ++ ) { maxAns += maxArr [ i ] ; } return maxAns ; } public static void Main ( String [ ] args ) { int N = 5 ; int [ ] A = { 11 , 23 , 38 , 43 , 59 } ; int [ ] B = { 36 , 24 , 17 , 40 , 56 } ; Console . WriteLine ( findMaxSum ( A , B , N ) ) ; } }

Index/key variables: i, n
Accumulator variables: i, maxAns
Iterator variables: i
Class/struct names: GFG