dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Collections . Generic ; class GFG { static void SieveOfEratosthenes ( bool [ ] prime , int p_size ) { prime [ 0 ] = false ; prime [ 1 ] = false ; for ( int p = 2 ; p * p <= p_size ; p ++ ) { if ( prime [ p ] ) { for ( int i = p * 2 ; i <= p_size ; i += p ) prime [ i ] = false ; } } } static int sumOfElements ( int [ ] arr , int n ) { bool [ ] prime = new bool [ n + 1 ] ; for ( int i = 0 ; i < n + 1 ; i ++ ) prime [ i ] = true ; SieveOfEratosthenes ( prime , n + 1 ) ; Dictionary < int , int > m = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( m . ContainsKey ( arr [ i ] ) ) { var val = m [ arr [ i ] ] ; m . Remove ( arr [ i ] ) ; m . Add ( arr [ i ] , val + 1 ) ; } else { m . Add ( arr [ i ] , 1 ) ; } } int sum = 0 ; foreach ( KeyValuePair < int , int > entry in m ) { int key = entry . Key ; int value = entry . Value ; if ( prime [ value ] ) { sum += ( key ) ; } } return sum ; } public static void Main ( String [ ] args ) { int [ ] arr = { 5 , 4 , 6 , 5 , 4 , 6 } ; int n = arr . Length ; Console . WriteLine ( sumOfElements ( arr , n ) ) ; } }

Index/key variables: i, p, value
Accumulator variables: i, p, sum
Iterator variables: entry, i, p
Class/struct names: GFG
C# program:
using System ; public class GFG { static bool isPalindrome ( int num ) { int reverse_num = 0 , remainder , temp ; temp = num ; while ( temp != 0 ) { remainder = temp % 10 ; reverse_num = reverse_num * 10 + remainder ; temp /= 10 ; } if ( reverse_num == num ) { return true ; } return false ; } static bool isOddLength ( int num ) { int count = 0 ; while ( num > 0 ) { num /= 10 ; count ++ ; } if ( count % 2 != 0 ) { return true ; } return false ; } static long sumOfAllPalindrome ( int L , int R ) { long sum = 0 ; if ( L <= R ) for ( int i = L ; i <= R ; i ++ ) { if ( isPalindrome ( i ) && isOddLength ( i ) ) { sum += i ; } } return sum ; } public static void Main ( String [ ] args ) { int L = 110 , R = 1130 ; Console . WriteLine ( sumOfAllPalindrome ( L , R ) ) ; } }

Accumulator variables: count, i, num, sum, temp
Iterator variables: i
Class/struct names: GFG
C# program:
using System . Collections . Generic ; using System ; class GFG { static int fact ( int n ) { int f = 1 ; for ( int i = 2 ; i <= n ; i ++ ) f = f * i ; return f ; } static int waysOfConsonants ( int size1 , int [ ] freq ) { int ans = fact ( size1 ) ; for ( int i = 0 ; i < 26 ; i ++ ) { if ( i == 0 i == 4 i == 8 i == 14 i == 20 ) continue ; else ans = ans / fact ( freq [ i ] ) ; } return ans ; } static int waysOfVowels ( int size2 , int [ ] freq ) { return fact ( size2 ) / ( fact ( freq [ 0 ] ) * fact ( freq [ 4 ] ) * fact ( freq [ 8 ] ) * fact ( freq [ 14 ] ) * fact ( freq [ 20 ] ) ) ; } static int countWays ( string str ) { int [ ] freq = new int [ 200 ] ; for ( int i = 0 ; i < 200 ; i ++ ) freq [ i ] = 0 ; for ( int i = 0 ; i < str . Length ; i ++ ) freq [ str [ i ] - ' a ' ] ++ ; int vowel = 0 , consonant = 0 ; for ( int i = 0 ; i < str . Length ; i ++ ) { if ( str [ i ] != ' a ' && str [ i ] != ' e ' && str [ i ] != ' i ' && str [ i ] != ' o ' && str [ i ] != ' u ' ) consonant ++ ; else vowel ++ ; } return waysOfConsonants ( consonant + 1 , freq ) * waysOfVowels ( vowel , freq ) ; } public static void Main ( ) { string str = " geeksforgeeks " ; Console . WriteLine ( countWays ( str ) ) ; } }

Index/key variables: i
Accumulator variables: consonant, i, vowel
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static double calculateAlternateSum ( int n ) { if ( n <= 0 ) return 0 ; int [ ] fibo = new int [ n + 1 ] ; fibo [ 0 ] = 0 ; fibo [ 1 ] = 1 ; double sum = Math . Pow ( fibo [ 0 ] , 2 ) + Math . Pow ( fibo [ 1 ] , 2 ) ; for ( int i = 2 ; i <= n ; i ++ ) { fibo [ i ] = fibo [ i - 1 ] + fibo [ i - 2 ] ; if ( i % 2 == 0 ) sum -= fibo [ i ] ; else sum += fibo [ i ] ; } return sum ; } public static void Main ( ) { int n = 8 ; Console . WriteLine ( " Alternating ▁ Fibonacci ▁ Sum ▁ upto ▁ " + n + " ▁ terms : ▁ " + calculateAlternateSum ( n ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int getValue ( int n ) { int i = 0 , k = 1 ; while ( i < n ) { i = i + k ; k = k * 2 ; } return k / 2 ; } public static void Main ( ) { int n = 9 ; Console . WriteLine ( getValue ( n ) ) ; n = 1025 ; Console . WriteLine ( getValue ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void countDigits ( double val , long [ ] arr ) { while ( ( long ) val > 0 ) { long digit = ( long ) val % 10 ; arr [ ( int ) digit ] ++ ; val = ( long ) val / 10 ; } return ; } static void countFrequency ( int x , int n ) { long [ ] freq_count = new long [ 10 ] ; for ( int i = 1 ; i <= n ; i ++ ) { double val = Math . Pow ( ( double ) x , ( double ) i ) ; countDigits ( val , freq_count ) ; } for ( int i = 0 ; i <= 9 ; i ++ ) { Console . Write ( freq_count [ i ] + " ▁ " ) ; } } public static void Main ( ) { int x = 15 , n = 3 ; countFrequency ( x , n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countSolutions ( int a ) { int count = 0 ; for ( int i = 0 ; i <= a ; i ++ ) { if ( a == ( i + ( a ^ i ) ) ) count ++ ; } return count ; } public static void Main ( ) { int a = 3 ; Console . WriteLine ( countSolutions ( a ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
class GFG { static int countSolutions ( int a ) { int count = bitCount ( a ) ; count = ( int ) System . Math . Pow ( 2 , count ) ; return count ; } static int bitCount ( int n ) { int count = 0 ; while ( n != 0 ) { count ++ ; n &= ( n - 1 ) ; } return count ; } public static void Main ( ) { int a = 3 ; System . Console . WriteLine ( countSolutions ( a ) ) ; } }

Accumulator variables: count, n
Class/struct names: GFG
C# program:
using System ; class GFG { static int calculateAreaSum ( int l , int b ) { int size = 1 ; int maxSize = Math . Min ( l , b ) ; int totalArea = 0 ; for ( int i = 1 ; i <= maxSize ; i ++ ) { int totalSquares = ( l - size + 1 ) * ( b - size + 1 ) ; int area = totalSquares * size * size ; totalArea += area ; size ++ ; } return totalArea ; } public static void Main ( ) { int l = 4 , b = 3 ; Console . Write ( calculateAreaSum ( l , b ) ) ; } }

Accumulator variables: i, size, totalArea
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static long boost_hyperfactorial ( long num ) { long val = 1 ; for ( long i = 1 ; i <= num ; i ++ ) { val = val * ( long ) Math . Pow ( i , i ) ; } return val ; } public static void Main ( ) { int num = 5 ; Console . WriteLine ( boost_hyperfactorial ( num ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int boost_hyperfactorial ( int num ) { int val = 1 ; for ( int i = 1 ; i <= num ; i ++ ) { for ( int j = 1 ; j <= i ; j ++ ) { val *= i ; } } return val ; } public static void Main ( ) { int num = 5 ; Console . WriteLine ( boost_hyperfactorial ( num ) ) ; } }

Accumulator variables: i, j, val
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int subtractOne ( int x ) { int m = 1 ; while ( ! ( ( x & m ) > 0 ) ) { x = x ^ m ; m <<= 1 ; } x = x ^ m ; return x ; } public static void Main ( ) { Console . WriteLine ( subtractOne ( 13 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int rows = 3 ; static int cols = 3 ; static void meanVector ( int [ , ] mat ) { Console . Write ( " [ ▁ " ) ; for ( int i = 0 ; i < rows ; i ++ ) { double mean = 0.00 ; int sum = 0 ; for ( int j = 0 ; j < cols ; j ++ ) sum += mat [ j , i ] ; mean = sum / rows ; Console . Write ( ( int ) mean + " ▁ " ) ; } Console . Write ( " ] " ) ; } public static void Main ( ) { int [ , ] mat = { { 1 , 2 , 3 } , { 4 , 5 , 6 } , { 7 , 8 , 9 } } ; meanVector ( mat ) ; } }

Accumulator variables: i, j, sum
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static List < int > primeFactors ( int n ) { List < int > res = new List < int > ( ) ; if ( n % 2 == 0 ) { while ( n % 2 == 0 ) n = n / 2 ; res . Add ( 2 ) ; } for ( int i = 3 ; i <= Math . Sqrt ( n ) ; i = i + 2 ) { if ( n % i == 0 ) { while ( n % i == 0 ) n = n / i ; res . Add ( i ) ; } } if ( n > 2 ) res . Add ( n ) ; return res ; } static bool isHoax ( int n ) { List < int > pf = primeFactors ( n ) ; if ( pf [ 0 ] == n ) return false ; int all_pf_sum = 0 ; for ( int i = 0 ; i < pf . Count ; i ++ ) { int pf_sum ; for ( pf_sum = 0 ; pf [ i ] > 0 ; pf_sum += pf [ i ] % 10 , pf [ i ] /= 10 ) ; all_pf_sum += pf_sum ; } int sum_n ; for ( sum_n = 0 ; n > 0 ; sum_n += n % 10 , n /= 10 ) ; return sum_n == all_pf_sum ; } public static void Main ( ) { int n = 84 ; if ( isHoax ( n ) ) Console . Write ( " A ▁ Hoax ▁ Number STRNEWLINE " ) ; else Console . Write ( " Not ▁ a ▁ Hoax ▁ Number STRNEWLINE " ) ; } }

Index/key variables: i
Accumulator variables: all_pf_sum, i, n, pf_sum, sum_n
Iterator variables: i, pf_sum, sum_n
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void LucasLehmer ( int n ) { long current_val = 4 ; List < long > series = new List < long > ( ) ; series . Add ( current_val ) ; for ( int i = 0 ; i < n ; i ++ ) { current_val = current_val * current_val - 2 ; series . Add ( current_val ) ; } for ( int i = 0 ; i <= n ; i ++ ) Console . WriteLine ( " Term ▁ " + i + " : ▁ " + series [ i ] ) ; } static void Main ( ) { int n = 5 ; LucasLehmer ( n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int modInverse ( int a , int prime ) { a = a % prime ; for ( int x = 1 ; x < prime ; x ++ ) if ( ( a * x ) % prime == 1 ) return x ; return - 1 ; } static void printModIverses ( int n , int prime ) { for ( int i = 1 ; i <= n ; i ++ ) Console . Write ( modInverse ( i , prime ) + " ▁ " ) ; } public static void Main ( ) { int n = 10 , prime = 17 ; printModIverses ( n , prime ) ; } }

Accumulator variables: i, x
Iterator variables: i, x
Class/struct names: GFG
C# program:
using System ; class GFG { static int minOp ( int num ) { int rem ; int count = 0 ; while ( num > 0 ) { rem = num % 10 ; if ( ! ( rem == 3 rem == 8 ) ) count ++ ; num /= 10 ; } return count ; } public static void Main ( ) { int num = 234198 ; Console . WriteLine ( " Minimum ▁ Operations ▁ = " + minOp ( num ) ) ; } }

Accumulator variables: count, num
Class/struct names: GFG
C# program:
using System ; class GFG { static int sumOfDigits ( int a ) { int sum = 0 ; while ( a != 0 ) { sum += a % 10 ; a /= 10 ; } return sum ; } static int findMax ( int x ) { int b = 1 , ans = x ; while ( x != 0 ) { int cur = ( x - 1 ) * b + ( b - 1 ) ; if ( sumOfDigits ( cur ) > sumOfDigits ( ans ) || ( sumOfDigits ( cur ) == sumOfDigits ( ans ) && cur > ans ) ) ans = cur ; x /= 10 ; b *= 10 ; } return ans ; } public static void Main ( ) { int n = 521 ; Console . WriteLine ( findMax ( n ) ) ; } }

Accumulator variables: a, b, sum, x
Class/struct names: GFG
C# program:
using System ; class GFG { static int median ( int [ ] a , int l , int r ) { int n = r - l + 1 ; n = ( n + 1 ) / 2 - 1 ; return n + l ; } static int IQR ( int [ ] a , int n ) { Array . Sort ( a ) ; int mid_index = median ( a , 0 , n ) ; int Q1 = a [ median ( a , 0 , mid_index ) ] ; int Q3 = a [ mid_index + median ( a , mid_index + 1 , n ) ] ; return ( Q3 - Q1 ) ; } public static void Main ( ) { int [ ] a = { 1 , 19 , 7 , 6 , 5 , 9 , 12 , 27 , 18 , 2 , 15 } ; int n = a . Length ; Console . WriteLine ( IQR ( a , n ) ) ; } }

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 int largestPalindrome ( int [ ] A , int n ) { Array . Sort ( A ) ; for ( int i = n - 1 ; i >= 0 ; -- i ) { if ( isPalindrome ( A [ i ] ) ) return A [ i ] ; } return - 1 ; } public static void Main ( ) { int [ ] A = { 1 , 232 , 54545 , 999991 } ; int n = A . Length ; Console . WriteLine ( largestPalindrome ( A , n ) ) ; } }

Index/key variables: i
Accumulator variables: divisor
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findSum ( int n , int a , int b ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) if ( i % a == 0 i % b == 0 ) sum += i ; return sum ; } static void Main ( ) { int n = 10 , a = 3 , b = 5 ; Console . WriteLine ( findSum ( n , a , b ) ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int subtractOne ( int x ) { return ( ( x << 1 ) + ( ~ x ) ) ; } public static void Main ( String [ ] args ) { Console . Write ( " { 0 } " , subtractOne ( 13 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class PellNumber { public static int pell ( int n ) { if ( n <= 2 ) return n ; return 2 * pell ( n - 1 ) + pell ( n - 2 ) ; } public static void Main ( ) { int n = 4 ; Console . Write ( pell ( n ) ) ; } }

Class/struct names: PellNumber
C# program:
using System ; using System . Collections ; class GFG { static long LCM ( int [ ] arr , int n ) { int max_num = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( max_num < arr [ i ] ) { max_num = arr [ i ] ; } } long res = 1 ; while ( x <= max_num ) { ArrayList indexes = new ArrayList ( ) ; for ( int j = 0 ; j < n ; j ++ ) { if ( arr [ j ] % x == 0 ) { indexes . Add ( j ) ; } } if ( indexes . Count >= 2 ) { for ( int j = 0 ; j < indexes . Count ; j ++ ) { arr [ ( int ) indexes [ j ] ] = arr [ ( int ) indexes [ j ] ] / x ; } res = res * x ; } else { x ++ ; } } for ( int i = 0 ; i < n ; i ++ ) { res = res * arr [ i ] ; } return res ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 3 , 4 , 5 , 10 , 20 , 35 } ; int n = arr . Length ; Console . WriteLine ( LCM ( arr , n ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, x
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static int politness ( int n ) { int count = 0 ; for ( int i = 2 ; i <= Math . Sqrt ( 2 * n ) ; i ++ ) { int a ; if ( ( 2 * n ) % i != 0 ) continue ; a = 2 * n ; a /= i ; a -= ( i - 1 ) ; if ( a % 2 != 0 ) continue ; a /= 2 ; if ( a > 0 ) { count ++ ; } } return count ; } public static void Main ( String [ ] args ) { int n = 90 ; Console . WriteLine ( " Politness ▁ of ▁ " + n + " ▁ = ▁ " + politness ( n ) ) ; n = 15 ; Console . WriteLine ( " Politness ▁ of ▁ " + n + " ▁ = ▁ " + politness ( n ) ) ; } }

Accumulator variables: a, count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int MAX = 10000 ; static List < int > primes = new List < int > ( ) ; static void sieveSundaram ( ) { Boolean [ ] marked = new Boolean [ MAX / 2 + 100 ] ; for ( int i = 1 ; i <= ( Math . Sqrt ( MAX ) - 1 ) / 2 ; i ++ ) for ( int j = ( i * ( i + 1 ) ) << 1 ; j <= MAX / 2 ; j = j + 2 * i + 1 ) marked [ j ] = true ; primes . Add ( 2 ) ; for ( int i = 1 ; i <= MAX / 2 ; i ++ ) if ( marked [ i ] == false ) primes . Add ( 2 * i + 1 ) ; } static void findPrimes ( int n ) { if ( n <= 2 n % 2 != 0 ) { Console . WriteLine ( " Invalid ▁ Input ▁ " ) ; return ; } for ( int i = 0 ; primes [ i ] <= n / 2 ; i ++ ) { int diff = n - primes [ i ] ; if ( primes . Contains ( diff ) ) { Console . WriteLine ( primes [ i ] + " ▁ + ▁ " + diff + " ▁ = ▁ " + n ) ; return ; } } } public static void Main ( String [ ] args ) { sieveSundaram ( ) ; findPrimes ( 4 ) ; findPrimes ( 38 ) ; findPrimes ( 100 ) ; } }

Index/key variables: i, j
Accumulator variables: i
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int kPrimeFactor ( int n , int k ) { while ( n % 2 == 0 ) { k -- ; n = n / 2 ; if ( k == 0 ) return 2 ; } for ( int i = 3 ; i <= Math . Sqrt ( n ) ; i = i + 2 ) { while ( n % i == 0 ) { if ( k == 1 ) return i ; k -- ; n = n / i ; } } if ( n > 2 && k == 1 ) return n ; return - 1 ; } public static void Main ( ) { int n = 12 , k = 3 ; Console . WriteLine ( kPrimeFactor ( n , k ) ) ; n = 14 ; k = 3 ; Console . WriteLine ( kPrimeFactor ( n , k ) ) ; } }

Accumulator variables: k
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 10001 ; static void sieveOfEratosthenes ( int [ ] s ) { bool [ ] prime = new bool [ MAX + 1 ] ; for ( int i = 2 ; i <= MAX ; i += 2 ) s [ i ] = 2 ; for ( int i = 3 ; i <= MAX ; i += 2 ) { if ( prime [ i ] == false ) { s [ i ] = i ; for ( int j = i ; j * i <= MAX ; j += 2 ) { if ( prime [ i * j ] == false ) { prime [ i * j ] = true ; s [ i * j ] = i ; } } } } } static int kPrimeFactor ( int n , int k , int [ ] s ) { while ( n > 1 ) { if ( k == 1 ) return s [ n ] ; k -- ; n /= s [ n ] ; } return - 1 ; } static void Main ( ) { int [ ] s = new int [ MAX + 1 ] ; sieveOfEratosthenes ( s ) ; int n = 12 , k = 3 ; Console . WriteLine ( kPrimeFactor ( n , k , s ) ) ; n = 14 ; k = 3 ; Console . WriteLine ( kPrimeFactor ( n , k , s ) ) ; } }

Index/key variables: i, n
Accumulator variables: i, j, k, n
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public static int sumDivisorsOfDivisors ( int n ) { Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; for ( int j = 2 ; j <= Math . Sqrt ( n ) ; j ++ ) { int count = 0 ; while ( n % j == 0 ) { n /= j ; count ++ ; } if ( count != 0 ) mp . Add ( j , count ) ; } if ( n != 1 ) mp . Add ( n , 1 ) ; int ans = 1 ; foreach ( KeyValuePair < int , int > entry in mp ) { int pw = 1 ; int sum = 0 ; for ( int i = entry . Value + 1 ; i >= 1 ; i -- ) { sum += ( i * pw ) ; pw = entry . Key ; } ans *= sum ; } return ans ; } public static void Main ( String [ ] args ) { int n = 10 ; Console . WriteLine ( sumDivisorsOfDivisors ( n ) ) ; } }

Accumulator variables: ans, count, i, j, n, sum
Iterator variables: entry, i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int prime ( int n ) { if ( n % 2 != 0 ) n -= 2 ; else n -- ; int i , j ; for ( i = n ; i >= 2 ; i -= 2 ) { if ( i % 2 == 0 ) continue ; for ( j = 3 ; j <= Math . Sqrt ( i ) ; j += 2 ) { if ( i % j == 0 ) break ; } if ( j > Math . Sqrt ( i ) ) return i ; } return 2 ; } public static void Main ( ) { int n = 17 ; Console . Write ( prime ( n ) ) ; } }

Accumulator variables: i, j, n
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static string fractionToDecimal ( int numr , int denr ) { string res = " " ; Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; int rem = numr % denr ; while ( ( rem != 0 ) && ( ! mp . ContainsValue ( rem ) ) ) { mp [ rem ] = res . Length ; rem = rem * 10 ; int res_part = rem / denr ; res += res_part . ToString ( ) ; rem = rem % denr ; } if ( rem == 0 ) return " " ; else if ( mp . ContainsKey ( rem ) ) return res . Substring ( mp [ rem ] ) ; return " " ; } public static void Main ( string [ ] args ) { int numr = 50 , denr = 22 ; string res = fractionToDecimal ( numr , denr ) ; if ( res == " " ) Console . Write ( " No ▁ recurring ▁ sequence " ) ; else Console . Write ( " Recurring ▁ sequence ▁ is ▁ " + res ) ; } }

Index/key variables: rem
Accumulator variables: res
Class/struct names: GFG
C# program:
using System ; class GFG { static int has0 ( int x ) { while ( x != 0 ) { if ( x % 10 == 0 ) return 1 ; x /= 10 ; } return 0 ; } static int getCount ( int n ) { int count = 0 ; for ( int i = 1 ; i <= n ; i ++ ) count += has0 ( i ) ; return count ; } public static void Main ( ) { int n = 107 ; Console . WriteLine ( " Count ▁ of ▁ numbers ▁ from ▁ 1" + " ▁ to ▁ " + n + " ▁ is ▁ " + getCount ( n ) ) ; } }

Accumulator variables: count, i, x
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool squareRootExists ( int n , int p ) { n = n % p ; for ( int x = 2 ; x < p ; x ++ ) if ( ( x * x ) % p == n ) return true ; return false ; } public static void Main ( ) { int p = 7 ; int n = 2 ; if ( squareRootExists ( n , p ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: x
Iterator variables: x
Class/struct names: GFG
C# program:
using System ; public class GFG { static int Largestpower ( int n , int p ) { int ans = 0 ; while ( n > 0 ) { n /= p ; ans += n ; } return ans ; } public static void Main ( ) { int n = 10 ; int p = 3 ; Console . Write ( " ▁ The ▁ largest ▁ power ▁ of ▁ " + p + " ▁ that ▁ divides ▁ " + n + " ! ▁ is ▁ " + Largestpower ( n , p ) ) ; } }

Accumulator variables: ans, n
Class/struct names: GFG
C# program:
using System ; class Factorial { int factorial ( int n ) { return ( n == 1 n == 0 ) ? 1 : n * factorial ( n - 1 ) ; } public static void Main ( ) { Factorial obj = new Factorial ( ) ; int num = 5 ; Console . WriteLine ( " Factorial ▁ of ▁ " + num + " ▁ is ▁ " + obj . factorial ( num ) ) ; } }

Class/struct names: Factorial
C# program:
using System ; class GFG { static public void Main ( ) { int [ ] arr1 = { 1 , 2 , 3 } ; int [ ] arr2 = { 1 , 2 , 3 } ; int N = arr1 . Length ; int M = arr2 . Length ; Bitwise_AND_sum_i ( arr1 , arr2 , M , N ) ; } static void Bitwise_AND_sum_i ( int [ ] arr1 , int [ ] arr2 , int M , int N ) { int [ ] frequency = new int [ 32 ] ; for ( int i = 0 ; i < N ; i ++ ) { int bit_position = 0 ; int num = arr1 [ i ] ; while ( num != 0 ) { if ( ( num & 1 ) != 0 ) { frequency [ bit_position ] += 1 ; } bit_position += 1 ; num >>= 1 ; } } for ( int i = 0 ; i < M ; i ++ ) { int num = arr2 [ i ] ; int value_at_that_bit = 1 ; int bitwise_AND_sum = 0 ; for ( int bit_position = 0 ; bit_position < 32 ; bit_position ++ ) { if ( ( num & 1 ) != 0 ) { bitwise_AND_sum += frequency [ bit_position ] * value_at_that_bit ; } num >>= 1 ; value_at_that_bit <<= 1 ; } Console . Write ( bitwise_AND_sum + " ▁ " ) ; } } }

Index/key variables: bit_position, i
Accumulator variables: bit_position, bitwise_AND_sum, i
Iterator variables: bit_position, i
Class/struct names: GFG
C# program:
using System ; class GFG { static void FlipBits ( int n ) { for ( int bit = 0 ; bit < 32 ; bit ++ ) { if ( ( n >> bit ) % 2 > 0 ) { n = n ^ ( 1 << bit ) ; break ; } } Console . Write ( " The ▁ number ▁ after ▁ unsetting ▁ the ▁ " ) ; Console . Write ( " rightmost ▁ set ▁ bit ▁ " + n ) ; } static void Main ( ) { int N = 12 ; FlipBits ( N ) ; } }

Accumulator variables: bit
Iterator variables: bit
Class/struct names: GFG
C# program:
using System ; class GFG { static int bitwiseAndOdd ( int n ) { int result = 1 ; for ( int i = 3 ; i <= n ; i = i + 2 ) { result = ( result & i ) ; } return result ; } public static void Main ( ) { int n = 10 ; Console . WriteLine ( bitwiseAndOdd ( n ) ) ; } }

Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int bitwiseAndOdd ( int n ) { return 1 ; } public static void Main ( ) { int n = 10 ; Console . WriteLine ( bitwiseAndOdd ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static int reverseBits ( int n ) { int rev = 0 ; while ( n > 0 ) { rev <<= 1 ; if ( ( int ) ( n & 1 ) == 1 ) rev ^= 1 ; n >>= 1 ; } return rev ; } public static void Main ( ) { int n = 11 ; Console . WriteLine ( reverseBits ( n ) ) ; } }

Accumulator variables: rev
Class/struct names: GFG
C# program:
using System ; class GFG { static int countgroup ( int [ ] a , int n ) { int xs = 0 ; for ( int i = 0 ; i < n ; i ++ ) xs = xs ^ a [ i ] ; if ( xs == 0 ) return ( 1 << ( n - 1 ) ) - 1 ; return 0 ; } public static void Main ( ) { int [ ] a = { 1 , 2 , 3 } ; int n = a . Length ; Console . WriteLine ( countgroup ( a , n ) ) ; } }

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