dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static int n = 3 ; static int dotProduct ( int [ ] vect_A , int [ ] vect_B ) { int product = 0 ; for ( int i = 0 ; i < n ; i ++ ) product = product + vect_A [ i ] * vect_B [ i ] ; return product ; } static void crossProduct ( int [ ] vect_A , int [ ] vect_B , int [ ] cross_P ) { cross_P [ 0 ] = vect_A [ 1 ] * vect_B [ 2 ] - vect_A [ 2 ] * vect_B [ 1 ] ; cross_P [ 1 ] = vect_A [ 2 ] * vect_B [ 0 ] - vect_A [ 0 ] * vect_B [ 2 ] ; cross_P [ 2 ] = vect_A [ 0 ] * vect_B [ 1 ] - vect_A [ 1 ] * vect_B [ 0 ] ; } public static void Main ( ) { int [ ] vect_A = { 3 , - 5 , 4 } ; int [ ] vect_B = { 2 , 6 , 5 } ; int [ ] cross_P = new int [ n ] ; Console . Write ( " Dot ▁ product : " ) ; Console . WriteLine ( dotProduct ( vect_A , vect_B ) ) ; Console . Write ( " Cross ▁ product : " ) ; crossProduct ( vect_A , vect_B , cross_P ) ; for ( int i = 0 ; i < n ; i ++ ) Console . Write ( cross_P [ i ] + " ▁ " ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int totalNumber ( int n ) { return 8 * ( int ) Math . Pow ( 9 , n - 1 ) ; } static public void Main ( ) { int n = 3 ; Console . WriteLine ( totalNumber ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int MOD = 1000000007 ; static int power ( int x , int y , int p ) { int res = 1 ; x = x % p ; while ( y > 0 ) { if ( y % 2 == 1 ) res = ( 1 * res * x ) % p ; x = ( 1 * x * x ) % p ; } return res ; } static int countEvenWays ( int n ) { return power ( 2 , n / 2 - 1 , MOD ) ; } public static void Main ( ) { int n = 6 ; Console . WriteLine ( countEvenWays ( n ) ) ; n = 8 ; Console . WriteLine ( countEvenWays ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 1000001 ; static int [ ] factor = new int [ MAX ] ; static void cal_factor ( ) { factor [ 1 ] = 1 ; for ( int i = 2 ; i < MAX ; i ++ ) factor [ i ] = i ; for ( int i = 4 ; i < MAX ; i += 2 ) factor [ i ] = 2 ; for ( int i = 3 ; i * i < MAX ; i ++ ) { if ( factor [ i ] == i ) { for ( int j = i * i ; j < MAX ; j += i ) { if ( factor [ j ] == j ) factor [ j ] = i ; } } } } static int no_of_representations ( int [ ] a , int n ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int temp = a [ i ] ; int flag = 0 ; while ( factor [ temp ] != 1 ) { flag = - 1 ; count ++ ; temp = temp / factor [ temp ] ; } count += flag ; } return count ; } public static void Main ( ) { cal_factor ( ) ; int [ ] a = { 4 , 4 , 4 } ; int n = a . Length ; Console . WriteLine ( no_of_representations ( a , n ) ) ; } }

Index/key variables: MAX, i, j, temp
Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int coutSubSeq ( int [ ] A , int N , int M ) { int sum = 0 ; int ans = 0 ; for ( int i = 0 ; i < N ; i ++ ) { for ( int j = i + 1 ; j < N ; j ++ ) { for ( int k = j + 1 ; k < N ; k ++ ) { sum = A [ i ] + A [ j ] + A [ k ] ; if ( sum % M == 0 ) ans ++ ; } } } return ans ; } public static void Main ( ) { int M = 3 ; int [ ] A = { 1 , 2 , 4 , 3 } ; int N = A . Length ; Console . WriteLine ( coutSubSeq ( A , N , M ) ) ; } }

Index/key variables: i, j, k
Accumulator variables: ans, i, j, k
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static int countSubSeq ( int [ ] A , int N , int M ) { int ans = 0 ; int [ ] h = new int [ M ] ; for ( int i = 0 ; i < N ; i ++ ) { A [ i ] = A [ i ] % M ; h [ A [ i ] ] ++ ; } for ( int i = 0 ; i < M ; i ++ ) { for ( int j = i ; j < M ; j ++ ) { int rem = ( M - ( i + j ) % M ) % M ; if ( rem < j ) continue ; if ( i == j && rem == j ) ans += h [ i ] * ( h [ i ] - 1 ) * ( h [ i ] - 2 ) / 6 ; else if ( i == j ) ans += h [ i ] * ( h [ i ] - 1 ) * h [ rem ] / 2 ; else if ( i == rem ) ans += h [ i ] * ( h [ i ] - 1 ) * h [ j ] / 2 ; else if ( rem == j ) ans += h [ j ] * ( h [ j ] - 1 ) * h [ i ] / 2 ; else ans = ans + h [ i ] * h [ j ] * h [ rem ] ; } } return ans ; } public static void Main ( ) { int M = 3 ; int [ ] A = { 1 , 2 , 4 , 3 } ; int N = A . Length ; Console . WriteLine ( countSubSeq ( A , N , M ) ) ; } }

Index/key variables: M, i, j, rem
Accumulator variables: ans, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int findTerm ( int n ) { if ( n == 1 ) return n ; else { int term = 7 ; for ( int i = 2 ; i <= n ; i ++ ) term = term * 2 + ( i - 1 ) ; return term ; } } public static void Main ( ) { int n = 5 ; Console . WriteLine ( findTerm ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findNumber ( int n ) { n -- ; int i = 1 ; while ( n >= 0 ) { n -= i ; ++ i ; } return ( n + i ) ; } public static void Main ( ) { int n = 3 ; Console . WriteLine ( findNumber ( n ) ) ; } }

Accumulator variables: n
Class/struct names: GFG
C# program:
using System ; class GFG { static void result ( long n , long k , long t ) { if ( t <= k ) Console . WriteLine ( t ) ; else if ( t <= n ) Console . WriteLine ( k ) ; else { long temp = t - n ; temp = k - temp ; Console . WriteLine ( temp ) ; } } public static void Main ( ) { long n , k , t ; n = 10 ; k = 5 ; t = 12 ; result ( n , k , t ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float weightedMean ( int [ ] X , int [ ] W , int n ) { int sum = 0 , numWeight = 0 ; for ( int i = 0 ; i < n ; i ++ ) { numWeight = numWeight + X [ i ] * W [ i ] ; sum = sum + W [ i ] ; } return ( float ) ( numWeight ) / sum ; } public static void Main ( ) { int [ ] X = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 } ; int [ ] W = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 } ; int n = X . Length ; int m = W . Length ; if ( n == m ) Console . WriteLine ( weightedMean ( X , W , n ) ) ; else Console . WriteLine ( " - 1" ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static float harmonicMean ( float [ ] arr , int n ) { float sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum = sum + ( float ) 1 / arr [ i ] ; return ( float ) n / sum ; } public static void Main ( ) { float [ ] arr = { 13.5f , 14.5f , 14.8f , 15.2f , 16.1f } ; int n = arr . Length ; Console . WriteLine ( harmonicMean ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static float harmonicMean ( int [ ] arr , int [ ] freq , int n ) { float sum = 0 , frequency_sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { sum = sum + ( float ) freq [ i ] / arr [ i ] ; frequency_sum = frequency_sum + freq [ i ] ; } return ( frequency_sum / sum ) ; } public static void Main ( ) { int [ ] num = { 13 , 14 , 15 , 16 , 17 } ; int [ ] freq = { 2 , 5 , 13 , 7 , 3 } ; int n = num . Length ; Console . WriteLine ( harmonicMean ( num , freq , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void point ( int a , int b , int c , int d , int n ) { int x , flag = 0 ; for ( int i = 0 ; i < n ; i ++ ) { x = b + i * a ; if ( ( x - d ) % c == 0 && x - d >= 0 ) { Console . WriteLine ( x ) ; flag = 1 ; break ; } } if ( flag == 0 ) { Console . WriteLine ( " No ▁ collision ▁ point " ) ; } } public static void Main ( ) { int a = 20 ; int b = 2 ; int c = 9 ; int d = 19 ; int n = 20 ; point ( a , b , c , d , n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findArmstrong ( int low , int high ) { for ( int i = low + 1 ; i < high ; ++ i ) { int x = i ; int n = 0 ; while ( x != 0 ) { x /= 10 ; ++ n ; } int pow_sum = 0 ; x = i ; while ( x != 0 ) { int digit = x % 10 ; pow_sum += ( int ) Math . Pow ( digit , n ) ; x /= 10 ; } if ( pow_sum == i ) Console . Write ( i + " ▁ " ) ; } } public static void Main ( ) { int num1 = 100 ; int num2 = 400 ; findArmstrong ( num1 , num2 ) ; Console . WriteLine ( ) ; } }

Accumulator variables: pow_sum, x
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void gcdMax ( int [ ] a , int [ ] b , int n , int N ) { int [ ] cnt = new int [ N ] ; int [ ] first = new int [ N ] ; int [ ] second = new int [ N ] ; for ( int i = 0 ; i < n ; ++ i ) cnt [ a [ i ] ] = 1 ; for ( int i = 1 ; i < N ; ++ i ) for ( int j = i ; j < N ; j += i ) if ( cnt [ j ] > 0 ) first [ i ] = Math . Max ( first [ i ] , j ) ; cnt = new int [ N ] ; for ( int i = 0 ; i < n ; ++ i ) cnt [ b [ i ] ] = 1 ; for ( int i = 1 ; i < N ; ++ i ) for ( int j = i ; j < N ; j += i ) if ( cnt [ j ] > 0 ) second [ i ] = Math . Max ( second [ i ] , j ) ; int x ; for ( x = N - 1 ; x >= 0 ; x -- ) if ( first [ x ] > 0 && second [ x ] > 0 ) break ; Console . WriteLine ( first [ x ] + " ▁ " + second [ x ] ) ; } static int Main ( ) { int [ ] a = { 3 , 1 , 4 , 2 , 8 } ; int [ ] b = { 5 , 2 , 12 , 8 , 3 } ; int n = a . Length ; int N = 20 ; gcdMax ( a , b , n , N ) ; return 0 ; } }

Index/key variables: N, i, j, x
Accumulator variables: j, x
Iterator variables: i, j, x
Class/struct names: GFG
C# program:
using System ; using System . Collections ; class GFG { static void printPierpont ( int n ) { bool [ ] arr = new bool [ n + 1 ] ; int two = 1 , three = 1 ; while ( two + 1 < n ) { arr [ two ] = true ; while ( two * three + 1 < n ) { arr [ three ] = true ; arr [ two * three ] = true ; three *= 3 ; } three = 1 ; two *= 2 ; } ArrayList v = new ArrayList ( ) ; for ( int i = 0 ; i < n ; i ++ ) if ( arr [ i ] ) v . Add ( i + 1 ) ; arr = new bool [ n + 1 ] ; for ( int p = 2 ; p * p < n ; p ++ ) { if ( arr [ p ] == false ) for ( int i = p * 2 ; i < n ; i += p ) arr [ i ] = true ; } for ( int i = 0 ; i < v . Count ; i ++ ) if ( ! arr [ ( int ) v [ i ] ] ) Console . Write ( v [ i ] + " ▁ " ) ; } static void Main ( ) { int n = 200 ; printPierpont ( n ) ; } }

Index/key variables: i, p, three, two
Accumulator variables: i, p, three, two
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isWoodall ( int x ) { if ( x % 2 == 0 ) return false ; if ( x == 1 ) return true ; int p = 0 ; while ( x % 2 == 0 ) { x = x / 2 ; p ++ ; if ( p == x ) return true ; } return false ; } public static void Main ( ) { int x = 383 ; if ( isWoodall ( x ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: p
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void print_result ( int [ ] a , int n , int k , int m ) { List < List < int > > v = new List < List < int > > ( m ) ; for ( int i = 0 ; i < m ; i ++ ) v . Add ( new List < int > ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { int rem = a [ i ] % m ; v [ rem ] . Add ( a [ i ] ) ; if ( v [ rem ] . Count == k ) { for ( int j = 0 ; j < k ; j ++ ) Console . Write ( v [ rem ] [ j ] + " ▁ " ) ; return ; } } Console . Write ( " - 1" ) ; } public static void Main ( String [ ] args ) { int [ ] a = { 1 , 8 , 4 } ; int n = a . Length ; print_result ( a , n , 2 , 3 ) ; } }

Index/key variables: i, j, rem
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static char [ ] PrimeDigitNumber ( char [ ] N , int size ) { char [ ] ans = new char [ size ] ; int ns = 0 ; int small = 0 ; int i ; int [ ] p = { 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 0 } ; int [ ] prevprime = { 0 , 0 , 0 , 2 , 3 , 3 , 5 , 5 , 7 , 7 } ; if ( size == 1 ) { ans [ 0 ] = ( char ) ( prevprime [ N [ 0 ] - '0' ] + '0' ) ; ans [ 1 ] = ' \0' ; return ans ; } if ( N [ 0 ] == '1' ) { for ( i = 0 ; i < size - 1 ; i ++ ) ans [ i ] = '7' ; ans [ size - 1 ] = ' \0' ; return ans ; } for ( i = 0 ; i < size && small == 0 ; i ++ ) { if ( p [ N [ i ] - '0' ] == 1 ) { ans [ ns ++ ] = N [ i ] ; } else { if ( p [ N [ i ] - '0' ] == 0 && prevprime [ N [ i ] - '0' ] != 0 ) { ans [ ns ++ ] = ( char ) ( prevprime [ N [ i ] - '0' ] + '0' ) ; small = 1 ; } else if ( p [ N [ i ] - '0' ] == 0 && prevprime [ N [ i ] - '0' ] == 0 ) { int j = i ; while ( j > 0 && p [ N [ j ] - '0' ] == 0 && prevprime [ N [ j ] - '0' ] == 0 ) { ans [ j ] = N [ j ] = '7' ; N [ j - 1 ] = ( char ) ( prevprime [ N [ j - 1 ] - '0' ] + '0' ) ; ans [ j - 1 ] = N [ j - 1 ] ; small = 1 ; j -- ; } i = ns ; } } } if ( small == 0 ) { if ( prevprime [ N [ size - 1 ] - '0' ] + '0' != '0' ) ans [ size - 1 ] = ( char ) ( prevprime [ N [ size - 1 ] - '0' ] + '0' ) ; else { int j = size - 1 ; while ( j > 0 && prevprime [ N [ j ] - '0' ] == 0 ) { ans [ j ] = N [ j ] = '7' ; N [ j - 1 ] = ( char ) ( prevprime [ N [ j - 1 ] - '0' ] + '0' ) ; ans [ j - 1 ] = N [ j - 1 ] ; small = 1 ; j -- ; } } } for ( ; ns < size ; ns ++ ) ans [ ns ] = '7' ; ans [ ns ] = ' \0' ; int k = 0 ; while ( ans [ k ] == '0' ) k ++ ; return ans ; } static public void Main ( ) { char [ ] N = "1000" . ToCharArray ( ) ; int size = N . Length ; Console . WriteLine ( PrimeDigitNumber ( N , size ) ) ; } }

Index/key variables: i, j, k, ns, size
Accumulator variables: i, j, k, ns
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static int smallestX ( int n ) { int [ ] temp = new int [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) temp [ i ] = 0 ; if ( n == 0 ) return - 1 ; int count = 0 , x = 0 ; for ( x = 1 ; count < 10 ; x ++ ) { int y = x * n ; while ( y > 0 ) { if ( temp [ y % 10 ] == 0 ) { count ++ ; temp [ y % 10 ] = 1 ; } y /= 10 ; } } return x - 1 ; } static void Main ( ) { int n = 5 ; Console . Write ( smallestX ( n ) ) ; } }

Index/key variables: i
Accumulator variables: count, i, x, y
Iterator variables: i, x
Class/struct names: GFG
C# program:
using System ; class GFG { static int digSum ( int n ) { int sum = 0 , rem = 0 ; while ( n > 0 ) { rem = n % 10 ; sum += rem ; n /= 10 ; } return sum ; } static int findX ( int n ) { for ( int i = 0 ; i <= n ; i ++ ) if ( i + digSum ( i ) == n ) return i ; return - 1 ; } public static void Main ( ) { int n = 43 ; Console . Write ( " x ▁ = ▁ " + findX ( n ) ) ; } }

Accumulator variables: i, n, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void complement ( string number1 ) { char [ ] number = number1 . ToCharArray ( ) ; for ( int i = 0 ; i < number . Length ; i ++ ) if ( number [ i ] != ' . ' ) number [ i ] = ( char ) ( ( int ) ( '9' ) - ( int ) ( number [ i ] ) + ( int ) ( '0' ) ) ; System . Console . WriteLine ( "9 ' s ▁ complement ▁ is ▁ : ▁ " + new string ( number ) ) ; } public static void Main ( ) { String number = "345.45" ; complement ( number ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class main { static int countWays ( int n ) { int count = 0 ; for ( int i = 1 ; i * i < n ; i ++ ) if ( n % i == 0 ) count ++ ; return count ; } public static void Main ( ) { int n = 12 ; Console . WriteLine ( countWays ( n ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: main
C# program:
using System ; class GFG { static bool isDigitPresent ( int m , bool [ ] hash ) { while ( m > 0 ) { if ( hash [ m % 10 ] ) return true ; m = m / 10 ; } return false ; } static int countDivisibles ( int n ) { bool [ ] hash = new bool [ 10 ] ; int m = n ; while ( m > 0 ) { hash [ m % 10 ] = true ; m = m / 10 ; } int ans = 0 ; for ( int i = 1 ; i <= Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { if ( isDigitPresent ( i , hash ) ) ans ++ ; if ( n / i != i ) { if ( isDigitPresent ( n / i , hash ) ) ans ++ ; } } } return ans ; } public static void Main ( ) { int n = 15 ; Console . Write ( countDivisibles ( n ) ) ; } }

Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 100 ; static String s = " " ; static void luDecomposition ( int [ , ] mat , int n ) { int [ , ] lower = new int [ n , n ] ; int [ , ] upper = new int [ n , n ] ; for ( int i = 0 ; i < n ; i ++ ) { for ( int k = i ; k < n ; k ++ ) { int sum = 0 ; for ( int j = 0 ; j < i ; j ++ ) sum += ( lower [ i , j ] * upper [ j , k ] ) ; upper [ i , k ] = mat [ i , k ] - sum ; } for ( int k = i ; k < n ; k ++ ) { if ( i == k ) else { int sum = 0 ; for ( int j = 0 ; j < i ; j ++ ) sum += ( lower [ k , j ] * upper [ j , i ] ) ; lower [ k , i ] = ( mat [ k , i ] - sum ) / upper [ i , i ] ; } } } Console . WriteLine ( setw ( 2 ) + " TABSYMBOL Lower ▁ Triangular " + setw ( 10 ) + " Upper ▁ Triangular " ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) Console . Write ( setw ( 4 ) + lower [ i , j ] + " TABSYMBOL " ) ; Console . Write ( " TABSYMBOL " ) ; for ( int j = 0 ; j < n ; j ++ ) Console . Write ( setw ( 4 ) + upper [ i , j ] + " TABSYMBOL " ) ; Console . Write ( " STRNEWLINE " ) ; } } static String setw ( int noOfSpace ) { s = " " ; for ( int i = 0 ; i < noOfSpace ; i ++ ) s += " ▁ " ; return s ; } public static void Main ( String [ ] arr ) { int [ , ] mat = { { 2 , - 1 , - 2 } , { - 4 , 6 , 3 } , { - 4 , - 2 , 8 } } ; luDecomposition ( mat , 3 ) ; } }

Accumulator variables: i, j, k, s, sum
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static void printTwoDivisibleParts ( String num , int f , int s ) { int N = num . Length ; int [ ] prefixReminder = new int [ N + 1 ] ; int [ ] suffixReminder = new int [ N + 1 ] ; suffixReminder [ 0 ] = 0 ; for ( int i = 1 ; i < N ; i ++ ) suffixReminder [ i ] = ( suffixReminder [ i - 1 ] * 10 + ( num [ i - 1 ] - '0' ) ) % f ; prefixReminder [ N ] = 0 ; int base1 = 1 ; for ( int i = N - 1 ; i >= 0 ; i -- ) { prefixReminder [ i ] = ( prefixReminder [ i + 1 ] + ( num [ i ] - '0' ) * base1 ) % s ; base1 = ( base1 * 10 ) % s ; } for ( int i = 0 ; i < N ; i ++ ) { if ( prefixReminder [ i ] == 0 && suffixReminder [ i ] == 0 && num [ i ] != '0' ) { Console . WriteLine ( num . Substring ( 0 , i ) + " ▁ " + num . Substring ( i ) ) ; return ; } } Console . WriteLine ( " Not ▁ Possible " ) ; } public static void Main ( ) { String num = "246904096" ; int f = 12345 ; int s = 1024 ; printTwoDivisibleParts ( num , f , s ) ; } }

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

Index/key variables: i, j
Accumulator variables: ans, i, j, r
Iterator variables: i, j
Class/struct names: Subarray
C# program:
using System ; class GFG { static int sum ( int n ) { int rem = 0 ; int sum_of_digits = 0 ; while ( n > 0 ) { rem = n % 10 ; sum_of_digits += rem ; n = n / 10 ; } return sum_of_digits ; } static int count ( int n ) { int c = 0 ; for ( int i = n - 97 ; i <= n ; i ++ ) { int a = sum ( i ) ; int b = sum ( a ) ; if ( ( i + a + b ) == n ) { c += 1 ; } } return c ; } public static void Main ( ) { int n = 9939 ; Console . Write ( count ( n ) ) ; } }

Accumulator variables: c, i, sum_of_digits
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPowerOfK ( int n , int k ) { bool oneSeen = false ; while ( n > 0 ) { int digit = n % k ; if ( digit > 1 ) return false ; if ( digit == 1 ) { if ( oneSeen ) return false ; oneSeen = true ; } n /= k ; } return true ; } public static void Main ( ) { int n = 64 , k = 4 ; if ( isPowerOfK ( n , k ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: n
Boolean variables: oneSeen
Class/struct names: GFG
C# program:
using System ; class GFG { static long MAX_DIGITS = 20 ; static long isOctal ( long n ) { while ( n > 0 ) { if ( ( n % 10 ) >= 8 ) return 0 ; else n = n / 10 ; } return 1 ; } static long isPalindrome ( long n ) { long divide = ( isOctal ( n ) == 0 ) ? 8 : 10 ; long [ ] octal = new long [ MAX_DIGITS ] ; long i = 0 ; while ( n != 0 ) { octal [ i ++ ] = n % divide ; n = n / divide ; } for ( long j = i - 1 , k = 0 ; k <= j ; j -- , k ++ ) if ( octal [ j ] != octal [ k ] ) return 0 ; return 1 ; } static int Main ( ) { long n = 97 ; if ( isPalindrome ( n ) > 0 ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; return 0 ; } }

Index/key variables: MAX_DIGITS, j, k
Accumulator variables: i, j, k
Iterator variables: j
Class/struct names: GFG
C# program:
using System ; class GFG { static void printFactorialNums ( int n ) { int fact = 1 ; int x = 2 ; while ( fact <= n ) { Console . Write ( fact + " ▁ " ) ; fact = fact * x ; x ++ ; } } public static void Main ( ) { int n = 100 ; printFactorialNums ( n ) ; } }

Accumulator variables: x
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int sumDigitSquare ( int n ) { int sq = 0 ; while ( n > 0 ) { int digit = n % 10 ; sq += digit * digit ; n = n / 10 ; } return sq ; } static bool isHappy ( int n ) { HashSet < int > s = new HashSet < int > ( ) ; s . Add ( n ) ; while ( true ) { if ( n == 1 ) return true ; n = sumDigitSquare ( n ) ; if ( s . Contains ( n ) ) return false ; s . Add ( n ) ; } } public static void Main ( ) { int n = 23 ; if ( isHappy ( n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: sq
Class/struct names: GFG
C# program:
using System ; public class GFG { static bool isPrime ( int n ) { if ( n <= 1 ) return false ; if ( n <= 3 ) return true ; if ( n % 2 == 0 n % 3 == 0 ) return false ; for ( int i = 5 ; i * i <= n ; i = i + 6 ) if ( n % i == 0 || n % ( i + 2 ) == 0 ) return false ; return true ; } static bool isThreeDisctFactors ( long n ) { int sq = ( int ) Math . Sqrt ( n ) ; if ( 1L L * sq * sq != n ) return false ; return isPrime ( sq ) ? true : false ; } static public void Main ( ) { long num = 9 ; if ( isThreeDisctFactors ( num ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; num = 15 ; if ( isThreeDisctFactors ( num ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; num = 12397923568441 ; if ( isThreeDisctFactors ( num ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int computeLastDigit ( long A , long B ) { int variable = 1 ; if ( A == B ) return 1 ; else if ( ( B - A ) >= 5 ) return 0 ; else { for ( long i = A + 1 ; i <= B ; i ++ ) variable = ( int ) ( variable * ( i % 10 ) ) % 10 ; return variable % 10 ; } } public static void Main ( ) { Console . WriteLine ( computeLastDigit ( 2632 , 2634 ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static float sumOfAP ( float a , float d , int n ) { float sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { sum = sum + a ; a = a + d ; } return sum ; } public static void Main ( ) { int n = 20 ; float a = 2.5f , d = 1.5f ; Console . Write ( sumOfAP ( a , d , n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static long M = 1000000007 ; static long multiplyFactors ( int n ) { long prod = 1 ; for ( int i = 1 ; i * i <= n ; i ++ ) { if ( n % i == 0 ) { if ( n / i == i ) prod = ( prod * i ) % M ; else { prod = ( prod * i ) % M ; prod = ( prod * n / i ) % M ; } } } return prod ; } public static void Main ( ) { int n = 12 ; Console . Write ( multiplyFactors ( n ) ) ; } }

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