dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static void multiply ( int [ , ] T , int [ , ] M ) { int a , b , c , d , e , f , g , h , i ; a = T [ 0 , 0 ] * M [ 0 , 0 ] + T [ 0 , 1 ] * M [ 1 , 0 ] + T [ 0 , 2 ] * M [ 2 , 0 ] ; b = T [ 0 , 0 ] * M [ 0 , 1 ] + T [ 0 , 1 ] * M [ 1 , 1 ] + T [ 0 , 2 ] * M [ 2 , 1 ] ; c = T [ 0 , 0 ] * M [ 0 , 2 ] + T [ 0 , 1 ] * M [ 1 , 2 ] + T [ 0 , 2 ] * M [ 2 , 2 ] ; d = T [ 1 , 0 ] * M [ 0 , 0 ] + T [ 1 , 1 ] * M [ 1 , 0 ] + T [ 1 , 2 ] * M [ 2 , 0 ] ; e = T [ 1 , 0 ] * M [ 0 , 1 ] + T [ 1 , 1 ] * M [ 1 , 1 ] + T [ 1 , 2 ] * M [ 2 , 1 ] ; f = T [ 1 , 0 ] * M [ 0 , 2 ] + T [ 1 , 1 ] * M [ 1 , 2 ] + T [ 1 , 2 ] * M [ 2 , 2 ] ; g = T [ 2 , 0 ] * M [ 0 , 0 ] + T [ 2 , 1 ] * M [ 1 , 0 ] + T [ 2 , 2 ] * M [ 2 , 0 ] ; h = T [ 2 , 0 ] * M [ 0 , 1 ] + T [ 2 , 1 ] * M [ 1 , 1 ] + T [ 2 , 2 ] * M [ 2 , 1 ] ; i = T [ 2 , 0 ] * M [ 0 , 2 ] + T [ 2 , 1 ] * M [ 1 , 2 ] + T [ 2 , 2 ] * M [ 2 , 2 ] ; T [ 0 , 0 ] = a ; T [ 0 , 1 ] = b ; T [ 0 , 2 ] = c ; T [ 1 , 0 ] = d ; T [ 1 , 1 ] = e ; T [ 1 , 2 ] = f ; T [ 2 , 0 ] = g ; T [ 2 , 1 ] = h ; T [ 2 , 2 ] = i ; } static void power ( int [ , ] T , int n ) { if ( n == 0 n == 1 ) return ; int [ , ] M = { { 1 , 1 , 1 } , { 1 , 0 , 0 } , { 0 , 1 , 0 } } ; power ( T , n / 2 ) ; multiply ( T , T ) ; if ( n % 2 != 0 ) multiply ( T , M ) ; } static int tribonacci ( int n ) { int [ , ] T = { { 1 , 1 , 1 } , { 1 , 0 , 0 } , { 0 , 1 , 0 } } ; if ( n == 0 n == 1 ) return 0 ; else power ( T , n - 2 ) ; return T [ 0 , 0 ] ; } public static void Main ( ) { int n = 10 ; for ( int i = 0 ; i < n ; i ++ ) Console . Write ( tribonacci ( i ) + " ▁ " ) ; Console . WriteLine ( ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static float geometricMean ( int [ ] arr , int n ) { float sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum = sum + ( float ) Math . Log ( arr [ i ] ) ; sum = sum / n ; return ( float ) Math . Exp ( sum ) ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 } ; int n = arr . Length ; Console . WriteLine ( geometricMean ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class GFG { static long smallestNumber ( int n ) { if ( n >= 0 && n <= 9 ) { return n ; } Stack < int > digits = new Stack < int > ( ) ; for ( int i = 9 ; i >= 2 && n > 1 ; i -- ) { while ( n % i == 0 ) { digits . Push ( i ) ; n = n / i ; } } if ( n != 1 ) { return - 1 ; } long k = 0 ; while ( digits . Count != 0 ) { k = k * 10 + digits . Peek ( ) ; digits . Pop ( ) ; } return k ; } static public void Main ( ) { int n = 100 ; Console . Write ( smallestNumber ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static bool isMagic ( int n ) { int sum = 0 ; while ( n > 0 sum > 9 ) { if ( n == 0 ) { n = sum ; sum = 0 ; } sum += n % 10 ; n /= 10 ; } return ( sum == 1 ) ; } public static void Main ( ) { int n = 1234 ; if ( isMagic ( n ) ) Console . WriteLine ( " Magic ▁ Number " ) ; else Console . WriteLine ( " Not ▁ a ▁ magic ▁ Number " ) ; } }

Accumulator variables: n, sum
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public static void Main ( String [ ] args ) { int x = 1234 ; if ( x % 9 == 1 ) Console . Write ( " Magic ▁ Number " ) ; else Console . Write ( " Not ▁ a ▁ Magic ▁ Number " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static void printSequence ( int n ) { int a = 1 ; int ans = 2 ; int N = 1000000007 ; for ( int i = 1 ; i <= n ; i ++ ) { Console . Write ( ans + " ▁ " ) ; ans = ( ( a % N ) * ( ans % N ) ) % N ; a = ans ; ans = ( ans + 1 ) % N ; } } public static void Main ( ) { int n = 6 ; printSequence ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int c ; static int HailstoneNumbers ( int N ) { Console . Write ( N + " ▁ " ) ; if ( N == 1 && c == 0 ) { return c ; } else if ( N == 1 && c != 0 ) { c ++ ; return c ; } else if ( N % 2 == 0 ) { c ++ ; HailstoneNumbers ( N / 2 ) ; } else if ( N % 2 != 0 ) { c ++ ; HailstoneNumbers ( 3 * N + 1 ) ; } return c ; } public static void Main ( ) { int N = 7 ; int x ; x = HailstoneNumbers ( N ) ; Console . WriteLine ( ) ; Console . WriteLine ( " Number ▁ of ▁ Steps : ▁ " + x ) ; } }

Accumulator variables: c
Class/struct names: GFG
C# program:
using System ; class GFG { static int SUM ( int n , int m ) { if ( m == 1 ) return ( n * ( n + 1 ) / 2 ) ; int sum = SUM ( n , m - 1 ) ; return ( sum * ( sum + 1 ) / 2 ) ; } public static void Main ( ) { int n = 5 ; int m = 3 ; Console . Write ( " SUM ( " + n + " , ▁ " + m + " ) : ▁ " + SUM ( n , m ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int count ( int x , int y ) { Dictionary < int , int > m = new Dictionary < int , int > ( ) ; while ( x % y != 0 ) { x = x % y ; ans ++ ; if ( m . ContainsKey ( x ) ) return - 1 ; m . Add ( x , 1 ) ; x = x * 10 ; } return ans ; } public static void Main ( String [ ] args ) { int res = count ( 1 , 2 ) ; if ( ( res == - 1 ) ) Console . WriteLine ( " INF " ) ; else Console . WriteLine ( res ) ; res = count ( 5 , 3 ) ; if ( ( res == - 1 ) ) Console . WriteLine ( " INF " ) ; else Console . WriteLine ( res ) ; res = count ( 3 , 5 ) ; if ( ( res == - 1 ) ) Console . WriteLine ( " INF " ) ; else Console . WriteLine ( res ) ; } }

Accumulator variables: ans
Class/struct names: GFG
C# program:
using System ; class GFG { static int xorCalc ( int k ) { if ( k == 1 ) return 2 ; if ( ( ( k + 1 ) & k ) == 0 ) return k / 2 ; return 1 ; } public static void Main ( ) { int k = 31 ; Console . WriteLine ( xorCalc ( k ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static string findNthNo ( int n ) { string res = " " ; while ( n >= 1 ) { if ( ( n & 1 ) == 1 ) { res = res + "4" ; n = ( n - 1 ) / 2 ; } else { res = res + "7" ; n = ( n - 2 ) / 2 ; } } char [ ] arr = res . ToCharArray ( ) ; Array . Reverse ( arr ) ; return new string ( arr ) ; } public static void Main ( ) { int n = 13 ; Console . Write ( findNthNo ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int divCount ( int n ) { bool [ ] hash = new bool [ n + 1 ] ; for ( int p = 2 ; p * p < n ; p ++ ) if ( hash [ p ] == false ) for ( int i = p * 2 ; i < n ; i += p ) hash [ i ] = true ; int total = 1 ; for ( int p = 2 ; p <= n ; p ++ ) { if ( hash [ p ] == false ) { int count = 0 ; if ( n % p == 0 ) { while ( n % p == 0 ) { n = n / p ; count ++ ; } total = total * ( count + 1 ) ; } } } return total ; } public static void Main ( ) { int n = 24 ; Console . WriteLine ( divCount ( n ) ) ; } }

Index/key variables: i, p
Accumulator variables: count, i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { static int getMax ( int [ ] Arr ) { int max = Arr [ 0 ] ; for ( int i = 1 ; i < Arr . Length ; i ++ ) if ( Arr [ i ] > max ) max = Arr [ i ] ; return max ; } static int maxPrimefactorNum ( int N ) { int [ ] arr = new int [ N + 1 ] ; for ( int i = 2 ; i * i <= N ; i ++ ) { if ( arr [ i ] == 0 ) for ( int j = 2 * i ; j <= N ; j += i ) arr [ j ] ++ ; arr [ i ] = 1 ; } return getMax ( arr ) ; } public static void Main ( ) { int N = 40 ; Console . WriteLine ( maxPrimefactorNum ( 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 String decToBin ( int n ) { if ( n == 0 ) return "0" ; String bin = " " ; while ( n > 0 ) { bin = ( ( n & 1 ) == 0 ? '0' : '1' ) + bin ; n >>= 1 ; } return bin ; } public static void Main ( ) { int n = 38 ; Console . WriteLine ( decToBin ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static int arraySum ( int [ ] arr , int n ) { int x = ( n + 1 ) / 2 ; return ( arr [ 0 ] - 1 ) * n + x * x ; } public static void Main ( ) { int [ ] arr = { 10 , 11 , 12 , 13 , 12 , 11 , 10 } ; int n = arr . Length ; Console . WriteLine ( arraySum ( arr , n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool isBalancePossible ( int T , int a ) { List < int > baseForm = new List < int > ( ) ; int s = 0 ; while ( T > 0 ) { baseForm . Add ( T % a ) ; T /= a ; s ++ ; } baseForm . Add ( 0 ) ; for ( int i = 0 ; i < s ; i ++ ) { if ( baseForm [ i ] != 0 && baseForm [ i ] != 1 && baseForm [ i ] != ( a - 1 ) && baseForm [ i ] != a ) { return false ; } if ( baseForm [ i ] == a || baseForm [ i ] == ( a - 1 ) ) { baseForm . Insert ( i + 1 , baseForm [ i + 1 ] + 1 ) ; } } return true ; } public static void Main ( ) { int T = 11 ; int a = 4 ; bool balancePossible = isBalancePossible ( T , a ) ; if ( balancePossible ) { Console . WriteLine ( " Balance ▁ is ▁ possible " ) ; } else { Console . WriteLine ( " Balance ▁ is ▁ not ▁ possible " ) ; } } }

Index/key variables: i
Accumulator variables: T, i, s
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static int countDigits ( int a , int b ) { if ( a == 0 b == 0 ) return 1 ; return ( int ) Math . Floor ( Math . Log10 ( Math . Abs ( a ) ) + Math . Log10 ( Math . Abs ( b ) ) ) + 1 ; } static void Main ( ) { int a = 33 ; int b = - 24 ; Console . Write ( countDigits ( a , b ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int lastPosition ( int n , int m , int k ) { if ( m <= n - k + 1 ) return m + k - 1 ; m = m - ( n - k + 1 ) ; return ( m % n == 0 ) ? n : ( m % n ) ; } public static void Main ( ) { int n = 5 ; int m = 8 ; int k = 2 ; Console . WriteLine ( lastPosition ( n , m , k ) ) ; } }

Class/struct names: GFG
C# program:
class GFG { static void primesInRange ( int n ) { int fact = 1 ; for ( int k = 2 ; k < n ; k ++ ) { fact = fact * ( k - 1 ) ; if ( ( fact + 1 ) % k == 0 ) System . Console . WriteLine ( k ) ; } } static void Main ( ) { int n = 15 ; primesInRange ( n ) ; } }

Accumulator variables: k
Iterator variables: k
Class/struct names: GFG
C# program:
using System ; class GFG { static double EPS = 1e-9 ; static void productPuzzle ( int [ ] a , int n ) { double sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum += Math . Log10 ( a [ i ] ) ; for ( int i = 0 ; i < n ; i ++ ) Console . Write ( ( int ) ( EPS + Math . Pow ( 10.00 , sum - Math . Log10 ( a [ i ] ) ) ) + " ▁ " ) ; } public static void Main ( ) { int [ ] a = { 10 , 3 , 5 , 6 , 2 } ; int n = a . Length ; Console . WriteLine ( " The ▁ product ▁ array ▁ is : ▁ " ) ; productPuzzle ( a , n ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int changeEvenBits ( int n ) { int to_subtract = 0 ; int m = 0 ; for ( int x = n ; x > 0 ; x >>= 2 ) { if ( ( x & 1 ) > 0 ) to_subtract += ( 1 << m ) ; m += 2 ; } return n - to_subtract ; } public static void Main ( ) { int n = 30 ; Console . Write ( changeEvenBits ( n ) ) ; } }

Accumulator variables: m, to_subtract
Iterator variables: x
Class/struct names: GFG
C# program:
using System ; class GFG { static int closestNumber ( int n , int m ) { int q = n / m ; int n1 = m * q ; int n2 = ( n * m ) > 0 ? ( m * ( q + 1 ) ) : ( m * ( q - 1 ) ) ; if ( Math . Abs ( n - n1 ) < Math . Abs ( n - n2 ) ) return n1 ; return n2 ; } public static void Main ( ) { int n = 13 , m = 4 ; Console . WriteLine ( closestNumber ( n , m ) ) ; n = - 15 ; m = 6 ; Console . WriteLine ( closestNumber ( n , m ) ) ; n = 0 ; m = 8 ; Console . WriteLine ( closestNumber ( n , m ) ) ; n = 18 ; m = - 7 ; Console . WriteLine ( closestNumber ( n , m ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool checkPronic ( int x ) { for ( int i = 0 ; i <= ( int ) ( Math . Sqrt ( x ) ) ; i ++ ) if ( x == i * ( i + 1 ) ) return true ; return false ; } public static void Main ( ) { for ( int i = 0 ; i <= 200 ; i ++ ) if ( checkPronic ( i ) ) Console . Write ( i + " ▁ " ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int findMinSum ( int num ) { int sum = 0 ; for ( int i = 2 ; i * i <= num ; i ++ ) { while ( num % i == 0 ) { sum += i ; num /= i ; } } sum += num ; return sum ; } public static void Main ( ) { int num = 12 ; Console . Write ( findMinSum ( num ) ) ; } }

Accumulator variables: i, num, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findMin ( int sum ) { int a = 0 , b = 0 ; while ( sum > 0 ) { if ( sum % 7 == 0 ) { b ++ ; sum -= 7 ; } else if ( sum % 4 == 0 ) { a ++ ; sum -= 4 ; } else { a ++ ; sum -= 4 ; } } if ( sum < 0 ) { Console . Write ( " - 1n " ) ; return ; } for ( int i = 0 ; i < a ; i ++ ) Console . Write ( "4" ) ; for ( int i = 0 ; i < b ; i ++ ) Console . Write ( "7" ) ; Console . WriteLine ( ) ; } public static void Main ( ) { findMin ( 15 ) ; } }

Accumulator variables: a, b, i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int minNum ( int [ ] arr , int n ) { int odd = 0 ; for ( int i = 0 ; i < n ; i ++ ) if ( arr [ i ] % 2 != 0 ) odd += 1 ; return ( ( odd % 2 ) != 0 ) ? 1 : 2 ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } ; int n = arr . Length ; Console . Write ( minNum ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, odd
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int printMaxNum ( int num ) { int [ ] count = new int [ 10 ] ; String str = num . ToString ( ) ; for ( int i = 0 ; i < str . Length ; i ++ ) count [ str [ i ] - '0' ] ++ ; int result = 0 , multiplier = 1 ; for ( int i = 0 ; i <= 9 ; i ++ ) { while ( count [ i ] > 0 ) { result = result + ( i * multiplier ) ; count [ i ] -- ; multiplier = multiplier * 10 ; } } return result ; } public static void Main ( ) { int num = 38293367 ; Console . Write ( printMaxNum ( num ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Text ; public class GFG { static String largestNumber ( String num ) { int n = num . Length ; int right ; int [ ] rightMax = new int [ n ] ; rightMax [ n - 1 ] = - 1 ; right = n - 1 ; for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( num [ i ] < num [ right ] ) rightMax [ i ] = right ; else { rightMax [ i ] = - 1 ; right = i ; } } for ( int i = 0 ; i < n ; i ++ ) { if ( rightMax [ i ] != - 1 ) { num = swap ( num , i , rightMax [ i ] ) ; break ; } } return num ; } static String swap ( String num , int i , int j ) { StringBuilder sb = new StringBuilder ( num ) ; sb [ i ] = num [ j ] ; sb [ j ] = num [ i ] ; return sb . ToString ( ) ; } public static void Main ( ) { String num = "8725634" ; Console . WriteLine ( " Largest ▁ Number ▁ : ▁ " + largestNumber ( num ) ) ; } }

Index/key variables: i, j, n, right
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int nCr ( int n , int r ) { if ( r > n / 2 ) r = n - r ; int answer = 1 ; for ( int i = 1 ; i <= r ; i ++ ) { answer *= ( n - r + i ) ; answer /= i ; } return answer ; } static float binomialProbability ( int n , int k , float p ) { return nCr ( n , k ) * ( float ) Math . Pow ( p , k ) * ( float ) Math . Pow ( 1 - p , n - k ) ; } public static void Main ( ) { int n = 10 ; int k = 5 ; float p = ( float ) 1.0 / 3 ; float probability = binomialProbability ( n , k , p ) ; Console . Write ( " Probability ▁ of ▁ " + k ) ; Console . Write ( " ▁ heads ▁ when ▁ a ▁ coin ▁ " + " is ▁ tossed ▁ " + n ) ; Console . Write ( " ▁ times ▁ where ▁ " + " probability ▁ of ▁ each ▁ head ▁ is ▁ " + p ) ; Console . Write ( " ▁ is ▁ = ▁ " + probability ) ; } }

Accumulator variables: answer, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static int findMaxGCD ( int [ ] arr , int n ) { int high = 0 ; for ( int i = 0 ; i < n ; i ++ ) high = Math . Max ( high , arr [ i ] ) ; int [ ] divisors = new int [ high + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 1 ; j <= Math . Sqrt ( arr [ i ] ) ; j ++ ) { if ( arr [ i ] % j == 0 ) { divisors [ j ] ++ ; if ( j != arr [ i ] / j ) divisors [ arr [ i ] / j ] ++ ; } } } for ( int i = high ; i >= 1 ; i -- ) if ( divisors [ i ] > 1 ) return i ; return 1 ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 4 , 8 , 8 , 12 } ; int n = arr . Length ; Console . WriteLine ( findMaxGCD ( 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 { public static int findMaxGCD ( int [ ] arr , int n ) { int high = 0 ; for ( int i = 0 ; i < n ; i ++ ) high = Math . Max ( high , arr [ i ] ) ; int [ ] count = new int [ high + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) count [ arr [ i ] ] ++ ; int counter = 0 ; for ( int i = high ; i >= 1 ; i -- ) { int j = i ; while ( j <= high ) { if ( count [ j ] > 0 ) counter += count [ j ] ; j += i ; if ( counter == 2 ) return i ; } counter = 0 ; } return 1 ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 4 , 8 , 8 , 12 } ; int n = arr . Length ; Console . WriteLine ( findMaxGCD ( arr , n ) ) ; } }

Index/key variables: i, j
Accumulator variables: counter, i, j
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int count_one ( int n ) { int c_one = 0 ; while ( n != 0 ) { int rem = n % 10 ; if ( rem == 1 ) c_one = c_one + 1 ; n = n / 10 ; } return c_one ; } static int checkEvil ( int n ) { int i = 0 , bin = 0 , n_one = 0 ; while ( n != 0 ) { int r = n % 2 ; bin = bin + r * ( int ) ( Math . Pow ( 10 , i ) ) ; n = n / 2 ; } n_one = count_one ( bin ) ; if ( n_one % 2 == 0 ) return 1 ; else return 0 ; } public static void Main ( String [ ] args ) { int check , num ; num = 32 ; check = checkEvil ( num ) ; if ( check == 1 ) Console . WriteLine ( num + " ▁ is ▁ Evil ▁ Number " ) ; else Console . WriteLine ( num + " ▁ is ▁ Odious ▁ Number " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int CountPairs ( int n ) { int k = n ; int imin = 1 ; int ans = 0 ; while ( imin <= n ) { int imax = n / k ; ans += k * ( imax - imin + 1 ) ; imin = imax + 1 ; k = n / imin ; } return ans ; } public static void Main ( String [ ] args ) { Console . WriteLine ( CountPairs ( 1 ) ) ; Console . WriteLine ( CountPairs ( 2 ) ) ; Console . WriteLine ( CountPairs ( 3 ) ) ; } }

Accumulator variables: ans
Class/struct names: GFG
C# program:
class GFG { static long powermod ( 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 modInverse ( long a , long m ) { long m0 = m , t , q ; long x0 = 0 , x1 = 1 ; if ( m == 1 ) return 0 ; while ( a > 1 ) { q = a / m ; t = m ; m = a % m ; a = t ; t = x0 ; x0 = x1 - q * x0 ; x1 = t ; } if ( x1 < 0 ) x1 += m0 ; return x1 ; } static long evaluteExpression ( long n ) { long firstsum = 0 , mod = 10 ; for ( int i = 2 , j = 0 ; ( 1 << j ) <= n ; i *= i , ++ j ) firstsum = ( firstsum + i ) % mod ; long secondsum = ( powermod ( 4L , n + 1 , mod ) - 1 ) * modInverse ( 3L , mod ) ; return ( firstsum * secondsum ) % mod ; } public static void Main ( ) { long n = 3 ; System . Console . WriteLine ( evaluteExpression ( n ) ) ; n = 10 ; System . Console . WriteLine ( evaluteExpression ( n ) ) ; } }

Accumulator variables: i, x1
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static readonly int MAX = 100001 ; class pair { public int F , S ; public pair ( int f , int s ) { F = f ; S = s ; } } static List < pair > [ ] factors = new List < pair > [ MAX ] ; static void sieveOfEratothenese ( ) { bool [ ] isPrime = new bool [ MAX ] ; for ( int i = 0 ; i < MAX ; i ++ ) isPrime [ i ] = true ; isPrime [ 0 ] = isPrime [ 1 ] = false ; for ( int i = 2 ; i < MAX ; i ++ ) { if ( isPrime [ i ] ) { for ( int j = i ; j < MAX ; j += i ) { int k , l ; isPrime [ j ] = false ; for ( k = j , l = 0 ; k % i == 0 ; l ++ , k /= i ) ; factors [ j ] . Add ( new pair ( i , l ) ) ; } } } } static int sumOfProperDivisors ( int num ) { int mul = 1 ; for ( int i = 0 ; i < factors [ num ] . Count ; i ++ ) mul *= ( int ) ( ( Math . Pow ( factors [ num ] [ i ] . F , factors [ num ] [ i ] . S + 1 ) - 1 ) / ( factors [ num ] [ i ] . F - 1 ) ) ; return mul - num ; } public static void Main ( String [ ] args ) { for ( int i = 0 ; i < MAX ; i ++ ) factors [ i ] = new List < pair > ( ) ; sieveOfEratothenese ( ) ; int [ ] arr = { 8 , 13 , 24 , 36 , 59 , 75 , 91 } ; for ( int i = 0 ; i < arr . Length ; i ++ ) Console . Write ( sumOfProperDivisors ( arr [ i ] ) + " ▁ " ) ; Console . WriteLine ( ) ; } }

Index/key variables: MAX, i, j, num
Accumulator variables: i, j, k, l, mul
Iterator variables: i, j, k
Class/struct names: GFG, pair
C# program:
using System ; public class GFG { static int PowerOFPINnfactorial ( int n , int p ) { int ans = 0 ; int temp = p ; while ( temp <= n ) { ans += n / temp ; temp = temp * p ; } return ans ; } public static void Main ( String [ ] args ) { Console . WriteLine ( PowerOFPINnfactorial ( 4 , 2 ) ) ; } }

Accumulator variables: ans
Class/struct names: GFG
C# program:
using System ; class GFG { static int decimalToBinary ( int N ) { int B_Number = 0 ; int cnt = 0 ; while ( N != 0 ) { int rem = N % 2 ; int c = ( int ) Math . Pow ( 10 , cnt ) ; B_Number += rem * c ; N /= 2 ; cnt ++ ; } return B_Number ; } static public void Main ( ) { int N = 17 ; Console . Write ( decimalToBinary ( N ) ) ; } }

Accumulator variables: B_Number, N, cnt
Class/struct names: GFG
C# program:
class GFG { public static int binaryToDecimal ( int n ) { int num = n ; int dec_value = 0 ; int base1 = 1 ; int temp = num ; while ( temp > 0 ) { int last_digit = temp % 10 ; temp = temp / 10 ; dec_value += last_digit * base1 ; base1 = base1 * 2 ; } return dec_value ; } public static void Main ( ) { int num = 10101001 ; System . Console . Write ( binaryToDecimal ( num ) ) ; } }

Accumulator variables: dec_value
Class/struct names: GFG
C# program:
class GFG { public static int stirlingFactorial ( double n ) { if ( n == 1 ) return 1 ; double z ; z = System . Math . Sqrt ( 2 * 3.14 * n ) * System . Math . Pow ( ( n / e ) , n ) ; return ( int ) ( z ) ; } public static void Main ( ) { System . Console . WriteLine ( stirlingFactorial ( 1 ) ) ; System . Console . WriteLine ( stirlingFactorial ( 2 ) ) ; System . Console . WriteLine ( stirlingFactorial ( 3 ) ) ; System . Console . WriteLine ( stirlingFactorial ( 4 ) ) ; System . Console . WriteLine ( stirlingFactorial ( 5 ) ) ; System . Console . WriteLine ( stirlingFactorial ( 6 ) ) ; System . Console . WriteLine ( stirlingFactorial ( 7 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class CountXor { static int countXorPair ( int [ ] arr , int n ) { int odd = 0 , even = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] % 2 == 0 ) even ++ ; else odd ++ ; } return odd * even ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 3 } ; Console . WriteLine ( countXorPair ( arr , arr . Length ) ) ; } }

Index/key variables: i
Accumulator variables: even, i, odd
Iterator variables: i
Class/struct names: CountXor
C# program:
using System ; class GFG { private static int MAX_ITERATIONS = 20 ; private static bool isLychrel ( long number ) { for ( int i = 0 ; i < MAX_ITERATIONS ; i ++ ) { number = number + reverse ( number ) ; if ( isPalindrome ( number ) ) return false ; } return true ; } private static bool isPalindrome ( long number ) { return number == reverse ( number ) ; } private static long reverse ( long number ) { long reverse = 0 ; while ( number > 0 ) { long remainder = number % 10 ; reverse = ( reverse * 10 ) + remainder ; number = number / 10 ; } return reverse ; } public static void Main ( ) { long number = 295 ; Console . Write ( number + " ▁ is ▁ lychrel ? ▁ " + isLychrel ( number ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG