dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static bool sumSquare ( int n ) { for ( long i = 1 ; i * i <= n ; i ++ ) for ( long j = 1 ; j * j <= n ; j ++ ) if ( i * i + j * j == n ) { Console . Write ( i + " ^ 2 ▁ + ▁ " + j + " ^ 2" ) ; return true ; } return false ; } public static void Main ( String [ ] args ) { int n = 25 ; if ( sumSquare ( n ) ) Console . Write ( " STRNEWLINE Yes " ) ; else Console . Write ( " STRNEWLINE No " ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int M = 6 ; static int N = 7 ; static void preCompute ( int [ , ] mat , int [ , ] prefixCnt ) { for ( int i = 0 ; i < M ; i ++ ) { for ( int j = 0 ; j < N ; j ++ ) { if ( mat [ i , j ] == 0 ) { prefixCnt [ i , j ] = 1 ; } else { prefixCnt [ i , j ] = 0 ; } } } for ( int i = 0 ; i < M ; i ++ ) for ( int j = 1 ; j < N ; j ++ ) prefixCnt [ i , j ] += prefixCnt [ i , j - 1 ] ; for ( int i = 1 ; i < M ; i ++ ) for ( int j = 0 ; j < N ; j ++ ) prefixCnt [ i , j ] += prefixCnt [ i - 1 , j ] ; } static int countQuery ( int [ , ] prefixCnt , int pi , int pj , int qi , int qj ) { int cnt = prefixCnt [ qi , qj ] ; if ( pi > 0 ) cnt -= prefixCnt [ pi - 1 , qj ] ; if ( pj > 0 ) cnt -= prefixCnt [ qi , pj - 1 ] ; if ( pi > 0 && pj > 0 ) cnt += prefixCnt [ pi - 1 , pj - 1 ] ; return cnt ; } static void count0s ( int [ , ] mat , int [ , ] Q , int sizeQ ) { int [ , ] prefixCnt = new int [ M , N ] ; preCompute ( mat , prefixCnt ) ; for ( int i = 0 ; i < sizeQ ; i ++ ) { Console . Write ( countQuery ( prefixCnt , Q [ i , 0 ] , Q [ i , 1 ] , Q [ i , 2 ] , Q [ i , 3 ] ) + " ▁ " ) ; } } public static void Main ( string [ ] args ) { int [ , ] mat = { { 0 , 1 , 0 , 1 , 1 , 1 , 0 } , { 1 , 0 , 1 , 1 , 1 , 0 , 1 } , { 1 , 1 , 0 , 0 , 1 , 1 , 0 } , { 1 , 1 , 1 , 1 , 1 , 0 , 1 } , { 0 , 0 , 1 , 0 , 1 , 1 , 1 } , { 1 , 1 , 0 , 1 , 1 , 0 , 1 } } ; int [ , ] Q = { { 0 , 1 , 3 , 2 } , { 2 , 2 , 4 , 5 } , { 4 , 3 , 5 , 6 } } ; int sizeQ = Q . GetLength ( 0 ) ; count0s ( mat , Q , sizeQ ) ; } }

Accumulator variables: cnt, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static bool check ( long a , long b ) { long c = 0 ; while ( a != 0 ) { c = c + a % 10 ; a = a / 10 ; } return ( c == b ) ; } static long root ( long n ) { bool found = false ; long mx = ( long ) 1E18 ; for ( long i = 0 ; i <= 90 ; i ++ ) { long s = i * i + 4 * n ; long sq = ( long ) Math . Sqrt ( s ) ; if ( sq * sq == s && check ( ( sq - i ) / 2 , i ) ) { found = true ; mx = Math . Min ( mx , ( sq - i ) / 2 ) ; } } if ( found ) return mx ; else return - 1 ; } public static void Main ( ) { long n = 110 ; Console . Write ( root ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Boolean variables: found
Class/struct names: GFG
C# program:
using System ; public class base_power { static int calculate ( int n , int power ) { int sum = 0 ; int bp = ( int ) Math . Pow ( n , power ) ; while ( bp != 0 ) { int d = bp % 10 ; sum += d ; bp /= 10 ; } return sum ; } public static void Main ( ) { int n = 5 ; int power = 4 ; Console . WriteLine ( calculate ( n , power ) ) ; } }

Accumulator variables: bp, sum
Class/struct names: base_power
C# program:
using System ; class GFG { static int __gcd ( int a , int b ) { return b == 0 ? a : __gcd ( b , a % b ) ; } static bool coprime ( int a , int b ) { return ( __gcd ( a , b ) == 1 ) ; } static void pairSum ( int n ) { int mid = n / 2 ; for ( int i = mid ; i >= 1 ; i -- ) { if ( coprime ( i , n - i ) == true ) { Console . Write ( i + " ▁ " + ( n - i ) ) ; break ; } } } public static void Main ( ) { int n = 11 ; pairSum ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void modBigNumber ( string num , long m ) { List < int > vec = new List < int > ( ) ; long mod = 0 ; for ( int i = 0 ; i < num . Length ; i ++ ) { int digit = num [ i ] - '0' ; mod = mod * 10 + digit ; int quo = ( int ) ( mod / m ) ; vec . Add ( quo ) ; mod = mod % m ; } Console . Write ( " Remainder ▁ : ▁ " + mod + " STRNEWLINE " ) ; Console . Write ( " Quotient ▁ : ▁ " ) ; bool zeroflag = false ; for ( int i = 0 ; i < vec . Count ; i ++ ) { if ( vec [ i ] == 0 && zeroflag == false ) { continue ; } zeroflag = true ; Console . Write ( vec [ i ] ) ; } return ; } public static void Main ( ) { string num = "14598499948265358486" ; long m = 487 ; modBigNumber ( num , m ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Boolean variables: zeroflag
Class/struct names: GFG
C# program:
using System ; using System . Collections ; class GFG { static int N = ( int ) 1E6 ; static bool [ ] fourDiv = new bool [ N + 1 ] ; static void fourDistinctFactors ( ) { bool [ ] primeAll = new bool [ N + 1 ] ; for ( int p = 2 ; p * p <= N ; p ++ ) { if ( primeAll [ p ] == false ) { for ( int i = p * 2 ; i <= N ; i += p ) primeAll [ i ] = true ; } } ArrayList prime = new ArrayList ( ) ; for ( int p = 2 ; p <= N ; p ++ ) if ( ! primeAll [ p ] ) prime . Add ( p ) ; for ( int i = 0 ; i < prime . Count ; ++ i ) { int p = ( int ) prime [ i ] ; if ( 1L * p * p * p <= N ) fourDiv [ p * p * p ] = true ; for ( int j = i + 1 ; j < prime . Count ; ++ j ) { int q = ( int ) prime [ j ] ; if ( 1L * p * q > N ) break ; fourDiv [ p * q ] = true ; } } } public static void Main ( ) { fourDistinctFactors ( ) ; int num = 10 ; if ( fourDiv [ num ] ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; num = 12 ; if ( fourDiv [ num ] ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i, j, num, p
Accumulator variables: i, p
Iterator variables: i, j, p
Class/struct names: GFG
C# program:
using System ; class GFG { static int leonardo ( int n ) { int [ ] dp = new int [ n + 1 ] ; dp [ 0 ] = dp [ 1 ] = 1 ; for ( int i = 2 ; i <= n ; i ++ ) dp [ i ] = dp [ i - 1 ] + dp [ i - 2 ] + 1 ; return dp [ n ] ; } public static void Main ( ) { Console . WriteLine ( leonardo ( 3 ) ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void Cholesky_Decomposition ( int [ , ] matrix , int n ) { int [ , ] lower = new int [ n , n ] ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j <= i ; j ++ ) { int sum = 0 ; if ( j == i ) { for ( int k = 0 ; k < j ; k ++ ) sum += ( int ) Math . Pow ( lower [ j , k ] , 2 ) ; lower [ j , j ] = ( int ) Math . Sqrt ( matrix [ j , j ] - sum ) ; } else { for ( int k = 0 ; k < j ; k ++ ) sum += ( lower [ i , k ] * lower [ j , k ] ) ; lower [ i , j ] = ( matrix [ i , j ] - sum ) / lower [ j , j ] ; } } } Console . WriteLine ( " ▁ Lower ▁ Triangular TABSYMBOL ▁ Transpose " ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) Console . Write ( lower [ i , j ] + " TABSYMBOL " ) ; Console . Write ( " " ) ; for ( int j = 0 ; j < n ; j ++ ) Console . Write ( lower [ j , i ] + " TABSYMBOL " ) ; Console . WriteLine ( ) ; } } static int Main ( ) { int n = 3 ; int [ , ] matrix = { { 4 , 12 , - 16 } , { 12 , 37 , - 43 } , { - 16 , - 43 , 98 } } ; Cholesky_Decomposition ( matrix , n ) ; return 0 ; } }

Accumulator variables: i, j, k, sum
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static float sumOfAP ( float a , float d , float n ) { float sum = ( n / 2 ) * ( 2 * a + ( n - 1 ) * d ) ; return sum ; } static public void Main ( ) { float n = 20 ; float a = 2.5f , d = 1.5f ; Console . WriteLine ( sumOfAP ( a , d , n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static int sumOfSeries ( int n ) { int x ; if ( n % 2 == 0 ) x = ( n / 2 ) * ( n + 1 ) ; else x = ( ( n + 1 ) / 2 ) * n ; return x * x ; } static public void Main ( ) { int n = 5 ; Console . WriteLine ( sumOfSeries ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int findValue ( int [ ] arr , int n ) { int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = 0 ; j < n ; j ++ ) ans = Math . Max ( ans , Math . Abs ( arr [ i ] - arr [ j ] ) + Math . Abs ( i - j ) ) ; return ans ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 3 , 1 } ; int n = arr . Length ; Console . Write ( findValue ( 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 findValue ( int [ ] arr , int n ) { int [ ] a = new int [ n ] ; int [ ] b = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = ( arr [ i ] + i ) ; b [ i ] = ( arr [ i ] - i ) ; } int x = a [ 0 ] , y = a [ 0 ] ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] > x ) x = a [ i ] ; if ( a [ i ] < y ) y = a [ i ] ; } int ans1 = ( x - y ) ; x = b [ 0 ] ; y = b [ 0 ] ; for ( int i = 0 ; i < n ; i ++ ) { if ( b [ i ] > x ) x = b [ i ] ; if ( b [ i ] < y ) y = b [ i ] ; } int ans2 = ( x - y ) ; return Math . Max ( ans1 , ans2 ) ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 3 , 1 } ; int n = arr . Length ; Console . WriteLine ( findValue ( arr , n ) ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int countsubarray ( int [ ] array , int n , int k ) { int count = 0 ; int i , j , mul ; for ( i = 0 ; i < n ; i ++ ) { if ( array [ i ] < k ) count ++ ; mul = array [ i ] ; for ( j = i + 1 ; j < n ; j ++ ) { mul = mul * array [ j ] ; if ( mul < k ) count ++ ; else break ; } } return count ; } static public void Main ( ) { int [ ] array = { 1 , 2 , 3 , 4 } ; int k = 10 ; int size = array . Length ; int count = countsubarray ( array , size , k ) ; Console . WriteLine ( count ) ; } }

Index/key variables: i, j
Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int noOfFactors ( int N ) { if ( N == 1 ) return 1 ; int count = 0 ; int ans = 1 ; while ( N % 2 == 0 ) { count ++ ; N = N / 2 ; } ans *= ( count / 3 + 1 ) ; for ( int i = 3 ; i * i <= N ; i = i + 2 ) { count = 0 ; while ( N % i == 0 ) { count ++ ; N = N / i ; } ans *= ( count / 3 + 1 ) ; } return ans ; } public static void Main ( String [ ] args ) { int N = 216 ; Console . Write ( noOfFactors ( N ) ) ; } }

Accumulator variables: ans, count
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 1000001 ; static int [ ] factor ; static void generatePrimeFactors ( ) { 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 calculateNoOFactors ( int n ) { if ( n == 1 ) return 1 ; int ans = 1 ; int dup = factor [ n ] ; int c = 1 ; int j = n / factor [ n ] ; while ( j != 1 ) { if ( factor [ j ] == dup ) c += 1 ; else { dup = factor [ j ] ; ans = ans * ( c + 1 ) ; c = 1 ; } j = j / factor [ j ] ; } ans = ans * ( c + 1 ) ; return ans ; } public static void Main ( ) { factor = new int [ MAX ] ; factor [ 0 ] = 0 ; generatePrimeFactors ( ) ; int [ ] a = { 10 , 30 , 100 , 450 , 987 } ; int q = a . Length ; for ( int i = 0 ; i < q ; i ++ ) Console . Write ( calculateNoOFactors ( a [ i ] ) + " ▁ " ) ; } }

Index/key variables: MAX, i, j, n
Accumulator variables: c, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public static void digit_product_Sum ( int N ) { int [ ] a = new int [ N + 1 ] ; int product = 1 ; a [ 0 ] = 1 ; for ( int i = 1 ; i <= N ; i ++ ) { product = a [ i - 1 ] / 10 ; if ( product == 0 ) product = 1 ; else product = a [ i - 1 ] % 10 ; int val = a [ i - 1 ] / 10 ; if ( val == 0 ) val = a [ i - 1 ] ; a [ i ] = a [ i - 1 ] + ( val * product ) ; } for ( int i = 0 ; i < N ; i ++ ) Console . Write ( a [ i ] + " ▁ " ) ; } public static void Main ( ) { int N = 10 ; digit_product_Sum ( N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static float geometricMean ( int [ ] arr , int n ) { float product = 1 ; for ( int i = 0 ; i < n ; i ++ ) product = product * arr [ i ] ; float gm = ( float ) Math . Pow ( product , ( float ) 1 / n ) ; return gm ; } 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 ; class GFG { static int SIZE = 4 ; static bool productOfSingelDgt ( int n ) { if ( n >= 0 && n <= 9 ) return true ; int [ ] prime = { 2 , 3 , 5 , 7 } ; for ( int i = 0 ; i < SIZE && n > 1 ; i ++ ) while ( n % prime [ i ] == 0 ) n = n / prime [ i ] ; return ( n == 1 ) ; } public static void Main ( ) { int n = 24 ; if ( productOfSingelDgt ( n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findSum ( int n ) { return n * ( n + 1 ) / 2 ; } public static void Main ( ) { int n = 5 ; Console . Write ( findSum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int findSum ( int n ) { if ( n % 2 == 0 ) return ( n / 2 ) * ( n + 1 ) ; else return ( ( n + 1 ) / 2 ) * n ; } public static void Main ( ) { int n = 5 ; Console . Write ( findSum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int maxPrimefactorNum ( int N ) { if ( N < 2 ) return 0 ; bool [ ] arr = new bool [ N + 1 ] ; int prod = 1 , res = 0 ; for ( int p = 2 ; p * p <= N ; p ++ ) { if ( arr [ p ] == false ) { for ( int i = p * 2 ; i <= N ; i += p ) arr [ i ] = true ; prod *= p ; if ( prod > N ) return res ; res ++ ; } } return res ; } public static void Main ( ) { int N = 500 ; Console . WriteLine ( maxPrimefactorNum ( N ) ) ; } }

Index/key variables: i, p
Accumulator variables: i, p, prod, res
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { public static void Main ( ) { int n = 8 ; int range = 12 ; for ( int i = 1 ; i <= range ; ++ i ) Console . Write ( n + " ▁ * ▁ " + i + " ▁ = ▁ " + n * i + " STRNEWLINE " ) ; } }

Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPalindrome ( int n ) { int divisor = 1 ; while ( n / divisor >= 10 ) divisor *= 10 ; while ( n != 0 ) { int leading = n / divisor ; int trailing = n % 10 ; if ( leading != trailing ) return false ; n = ( n % divisor ) / 10 ; divisor = divisor / 100 ; } return true ; } static public void Main ( ) { if ( isPalindrome ( 1001 ) ) Console . WriteLine ( " Yes , ▁ it ▁ " + " is ▁ Palindrome " ) ; else Console . WriteLine ( " No , ▁ not ▁ " + " Palindrome " ) ; } }

Accumulator variables: divisor
Class/struct names: GFG
C# program:
using System ; public class GFG { static bool check ( int n ) { if ( n <= 0 ) return false ; return 1162261467 % n == 0 ; } public static void Main ( ) { int n = 9 ; if ( check ( n ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static String printDemlo ( String str ) { int len = str . Length ; String res = " " ; for ( int i = 1 ; i <= len ; i ++ ) res += i . ToString ( ) ; for ( int i = len - 1 ; i >= 1 ; i -- ) res += i . ToString ( ) ; return res ; } public static void Main ( ) { String str = "111111" ; Console . WriteLine ( printDemlo ( str ) ) ; } }

Accumulator variables: i, res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static void dctTransform ( int [ , ] matrix , int m , int n ) { double pi = 3.142857 ; int i , j , k , l ; double [ , ] dct = new double [ m , n ] ; double ci , cj , dct1 , sum ; for ( i = 0 ; i < m ; i ++ ) { for ( j = 0 ; j < n ; j ++ ) { if ( i == 0 ) ci = 1 / Math . Sqrt ( m ) ; else ci = Math . Sqrt ( 2 ) / Math . Sqrt ( m ) ; if ( j == 0 ) cj = 1 / Math . Sqrt ( n ) ; else cj = Math . Sqrt ( 2 ) / Math . Sqrt ( n ) ; sum = 0 ; for ( k = 0 ; k < m ; k ++ ) { for ( l = 0 ; l < n ; l ++ ) { dct1 = matrix [ k , l ] * Math . Cos ( ( 2 * k + 1 ) * i * pi / ( 2 * m ) ) * Math . Cos ( ( 2 * l + 1 ) * j * pi / ( 2 * n ) ) ; sum = sum + dct1 ; } } dct [ i , j ] = ci * cj * sum ; } } for ( i = 0 ; i < m ; i ++ ) { for ( j = 0 ; j < n ; j ++ ) { Console . Write ( dct [ i , j ] ) ; } Console . WriteLine ( ) ; } } static void Main ( ) { const int m = 8 , n = 8 ; int [ , ] matrix = new int [ m , n ] { { 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 } , { 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 } , { 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 } , { 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 } , { 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 } , { 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 } , { 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 } , { 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 } } ; dctTransform ( matrix , m , n ) ; } }

Accumulator variables: i, j, k, l
Iterator variables: i, j, k, l
Class/struct names: GFG
C# program:
using System ; class GFG { static int NumberofTimes ( String str ) { int temporary_sum = 0 , count = 0 ; while ( str . Length > 1 ) { temporary_sum = 0 ; for ( int i = 0 ; i < str . Length ; i ++ ) temporary_sum += ( str [ i ] - '0' ) ; str = temporary_sum + " " ; count ++ ; } return count ; } public static void Main ( ) { String s = "991" ; Console . Write ( NumberofTimes ( s ) ) ; } }

Index/key variables: i
Accumulator variables: count, i, temporary_sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int calculateLeaps ( int n ) { if ( n == 0 n == 1 ) { return 1 ; } else { int leaps = 0 ; for ( int i = 0 ; i < n ; i ++ ) leaps += calculateLeaps ( i ) ; return leaps ; } } public static void Main ( ) { Console . WriteLine ( calculateLeaps ( 4 ) ) ; } }

Accumulator variables: i, leaps
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int power ( long x , long y , long p ) { long res = 1 ; while ( y > 0 ) { if ( ( y & 1 ) != 0 ) res = ( res * x ) % p ; x = ( x * x ) % p ; } return ( int ) res ; } static void printLastKDigits ( int a , int b , int k ) { Console . Write ( " Last ▁ " + k + " ▁ digits ▁ of ▁ " + a + " ^ " + b + " ▁ = ▁ " ) ; int temp = 1 ; for ( int i = 1 ; i <= k ; i ++ ) temp *= 10 ; temp = power ( a , b , temp ) ; for ( int i = 0 ; i < k - temp . ToString ( ) . Length ; i ++ ) Console . WriteLine ( 0 ) ; if ( temp != 0 ) Console . Write ( temp ) ; } public static void Main ( ) { int a = 11 ; int b = 3 ; int k = 2 ; printLastKDigits ( a , b , k ) ; } }

Accumulator variables: i, temp
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class main { static int reverseDigits ( int num ) { int rev = 0 ; while ( num > 0 ) { rev = rev * 10 + num % 10 ; num /= 10 ; } return rev ; } static int square ( int num ) { return ( num * num ) ; } static bool checkAdamNumber ( int num ) { int a = square ( num ) ; int b = square ( reverseDigits ( num ) ) ; if ( a == reverseDigits ( b ) ) return true ; return false ; } public static void Main ( String [ ] args ) { int num = 12 ; if ( checkAdamNumber ( num ) ) Console . WriteLine ( " Adam ▁ Number " ) ; else Console . WriteLine ( " Not ▁ a ▁ Adam ▁ Number " ) ; } }

Accumulator variables: num
Class/struct names: main
C# program:
using System ; public class GFG { static int totalDigits ( int n ) { int number_of_digits = 0 ; for ( int i = 1 ; i <= n ; i *= 10 ) number_of_digits += ( n - i + 1 ) ; return number_of_digits ; } public static void Main ( ) { int n = 13 ; Console . WriteLine ( totalDigits ( n ) ) ; } }

Accumulator variables: i, number_of_digits
Iterator variables: i
Class/struct names: GFG
C# program:
class GFG { static void numbersWith3Divisors ( int n ) { bool [ ] prime = new bool [ n + 1 ] ; prime [ 0 ] = prime [ 1 ] = true ; for ( int p = 2 ; p * p <= n ; p ++ ) { if ( prime [ p ] == false ) { for ( int i = p * 2 ; i <= n ; i += p ) prime [ i ] = true ; } } System . Console . WriteLine ( " Numbers ▁ with ▁ 3 ▁ divisors ▁ : ▁ " ) ; for ( int i = 0 ; i * i <= n ; i ++ ) if ( ! prime [ i ] ) System . Console . Write ( i * i + " ▁ " ) ; } public static void Main ( ) { int n = 96 ; numbersWith3Divisors ( n ) ; } }

Index/key variables: i, p
Accumulator variables: i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { static void decToHexa ( int n ) { char [ ] hexaDeciNum = new char [ 100 ] ; int i = 0 ; while ( n != 0 ) { int temp = 0 ; temp = n % 16 ; if ( temp < 10 ) { hexaDeciNum [ i ] = ( char ) ( temp + 48 ) ; i ++ ; } else { hexaDeciNum [ i ] = ( char ) ( temp + 55 ) ; i ++ ; } n = n / 16 ; } for ( int j = i - 1 ; j >= 0 ; j -- ) Console . Write ( hexaDeciNum [ j ] ) ; } public static void Main ( String [ ] args ) { int n = 2545 ; decToHexa ( n ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: j
Class/struct names: GFG
C# program:
using System ; public class GFG { static void decToBinary ( int n ) { int [ ] binaryNum = new int [ 32 ] ; int i = 0 ; while ( n > 0 ) { binaryNum [ i ] = n % 2 ; n = n / 2 ; i ++ ; } for ( int j = i - 1 ; j >= 0 ; j -- ) Console . Write ( binaryNum [ j ] ) ; } public static void Main ( ) { int n = 17 ; decToBinary ( n ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: j
Class/struct names: GFG
C# program:
using System ; class GFG { static long count_of_ways ( long n ) { long count = 0 ; count = ( n + 1 ) * ( n + 2 ) / 2 ; return count ; } public static void Main ( ) { long n = 3 ; Console . WriteLine ( count_of_ways ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int flipSign ( int a ) { int neg = 0 ; int tmp = a < 0 ? 1 : - 1 ; while ( a != 0 ) { neg += tmp ; a += tmp ; } return neg ; } static bool areDifferentSign ( int a , int b ) { return ( ( a < 0 && b > 0 ) || ( a > 0 && b < 0 ) ) ; } static int sub ( int a , int b ) { return a + flipSign ( b ) ; } static int mul ( int a , int b ) { if ( a < b ) return mul ( b , a ) ; int sum = 0 ; for ( int i = Math . Abs ( b ) ; i > 0 ; i -- ) sum += a ; if ( b < 0 ) sum = flipSign ( sum ) ; return sum ; } static int division ( int a , int b ) { if ( b == 0 ) throw new ArithmeticException ( ) ; int quotient = 0 , dividend ; int divisor = flipSign ( Math . Abs ( b ) ) ; for ( dividend = Math . Abs ( a ) ; dividend >= Math . Abs ( divisor ) ; dividend += divisor ) quotient ++ ; if ( areDifferentSign ( a , b ) ) quotient = flipSign ( quotient ) ; return quotient ; } public static void Main ( ) { Console . WriteLine ( " Subtraction ▁ is ▁ " + sub ( 4 , - 2 ) ) ; Console . WriteLine ( " Product ▁ is ▁ " + mul ( - 9 , 6 ) ) ; try { Console . WriteLine ( " Division ▁ is ▁ " + division ( 8 , 2 ) ) ; } catch ( Exception ) { Console . WriteLine ( " Exception ▁ : - ▁ Divide ▁ by ▁ 0" ) ; } } }

Accumulator variables: a, dividend, i, neg, quotient, sum
Iterator variables: dividend, i
Class/struct names: GFG
C# program:
using System ; class GFG { static int numOfCombinations ( int [ ] arr , int N ) { int [ ] C = { 0 , 0 , 0 } ; for ( int i = 0 ; i < N ; ++ i ) ++ C [ arr [ i ] % 3 ] ; return C [ 1 ] * C [ 2 ] + C [ 0 ] * ( C [ 0 ] - 1 ) / 2 + C [ 0 ] * ( C [ 0 ] - 1 ) * ( C [ 0 ] - 2 ) / 6 + C [ 1 ] * ( C [ 1 ] - 1 ) * ( C [ 1 ] - 2 ) / 6 + C [ 2 ] * ( C [ 2 ] - 1 ) * ( C [ 2 ] - 2 ) / 6 + C [ 0 ] * C [ 1 ] * C [ 2 ] ; } public static void Main ( ) { int [ ] arr1 = { 1 , 5 , 7 , 2 , 9 , 14 } ; Console . WriteLine ( numOfCombinations ( arr1 , 6 ) ) ; int [ ] arr2 = { 3 , 6 , 9 , 12 } ; Console . WriteLine ( numOfCombinations ( arr2 , 4 ) ) ; } }

Index/key variables: i
Iterator variables: i
Class/struct names: GFG