dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Collections . Generic ; class GFG { static void count_unique ( HashSet < int > s , int n ) { if ( s . Contains ( n ) ) return ; s . Add ( n ) ; n += 1 ; while ( n % 10 == 0 ) { n = n / 10 ; } count_unique ( s , n ) ; } public static void Main ( String [ ] args ) { int n = 10 ; HashSet < int > s = new HashSet < int > ( ) ; count_unique ( s , n ) ; Console . WriteLine ( s . Count ) ; } }

Accumulator variables: n
Class/struct names: GFG
C# program:
using System ; class GFG { static int maxBitElement ( int [ ] arr , int n ) { int num = 0 , max = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { int cnt = BitCount ( arr [ i ] ) ; if ( cnt > max ) { max = cnt ; num = arr [ i ] ; } } return num ; } static int BitCount ( int n ) { int count = 0 ; while ( n != 0 ) { count ++ ; n &= ( n - 1 ) ; } return count ; } public static void Main ( String [ ] args ) { int [ ] arr = { 3 , 2 , 4 , 7 , 1 , 10 , 5 , 8 , 9 , 6 } ; int n = arr . Length ; Console . Write ( maxBitElement ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: count, i, n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int N = 1000 ; static int countPairs ( int [ ] arr , int n ) { int size = ( 2 * N ) + 1 ; int [ ] freq = new int [ size ] ; for ( int i = 0 ; i < n ; i ++ ) { int x = arr [ i ] ; freq [ x + N ] ++ ; } int ans = 0 ; for ( int i = 0 ; i < size ; i ++ ) { if ( freq [ i ] > 0 ) { ans += ( ( freq [ i ] ) * ( freq [ i ] - 1 ) ) / 2 ; for ( int j = i + 2 ; j < 2001 ; j += 2 ) { if ( freq [ j ] > 0 && ( freq [ ( i + j ) / 2 ] > 0 ) ) { ans += ( freq [ i ] * freq [ j ] ) ; } } } } return ans ; } public static void Main ( ) { int [ ] arr = { 4 , 2 , 5 , 1 , 3 , 5 } ; int n = arr . Length ; Console . WriteLine ( countPairs ( arr , n ) ) ; } }

Index/key variables: i, j, size
Accumulator variables: ans, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int smallestSum ( int n ) { if ( n == 1 ) return 0 ; return ( 2 * ( int ) Math . Pow ( 10 , n - 1 ) ) ; } static int largestSum ( int n ) { return ( 2 * ( ( int ) Math . Pow ( 10 , n ) - 1 ) ) ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( " Largest ▁ = ▁ " + largestSum ( n ) ) ; Console . Write ( " Smallest ▁ = ▁ " + smallestSum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int count_pairs ( int [ ] a , int [ ] b , int n , int m ) { int odd1 = 0 , even1 = 0 ; int odd2 = 0 , even2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] % 2 == 1 ) { odd1 ++ ; } else { even1 ++ ; } } for ( int i = 0 ; i < m ; i ++ ) { if ( b [ i ] % 2 == 1 ) { odd2 ++ ; } else { even2 ++ ; } } int pairs = Math . Min ( odd1 , even2 ) + Math . Min ( odd2 , even1 ) ; return pairs ; } static public void Main ( ) { int [ ] a = { 9 , 14 , 6 , 2 , 11 } ; int [ ] b = { 8 , 4 , 7 , 20 } ; int n = a . Length ; int m = b . Length ; Console . WriteLine ( count_pairs ( a , b , n , m ) ) ; } }

Index/key variables: i
Accumulator variables: even1, even2, i, odd1, odd2
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int find_leftmost_unsetbit ( int n ) { int ind = - 1 ; int i = 1 ; while ( n > 0 ) { if ( ( n % 2 ) != 1 ) { ind = i ; } i ++ ; n >>= 1 ; } return ind ; } static void perform_steps ( int n ) { int left = find_leftmost_unsetbit ( n ) ; if ( left == - 1 ) { Console . Write ( " No ▁ steps ▁ required " ) ; return ; } int step = 1 ; while ( find_leftmost_unsetbit ( n ) != - 1 ) { if ( step % 2 == 0 ) { n += 1 ; Console . WriteLine ( " Step " + step + " : ▁ Increase ▁ by ▁ 1" ) ; } else { int m = find_leftmost_unsetbit ( n ) ; int num = ( int ) ( Math . Pow ( 2 , m ) - 1 ) ; n = n ^ num ; Console . WriteLine ( " Step " + step + " : ▁ Xor ▁ with ▁ " + num ) ; } step += 1 ; } } static public void Main ( ) { int n = 39 ; perform_steps ( n ) ; } }

Accumulator variables: i, n, step
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int vertices ( int N , int A , int B ) { int position = 0 ; int minisum = int . MaxValue ; int sum = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { if ( i == A i == B ) continue ; else { int x = Math . Abs ( i - A ) ; int y = Math . Abs ( i - B ) ; sum = x + y ; if ( sum < minisum ) { minisum = sum ; position = i ; } } } return position ; } public static void Main ( String [ ] args ) { int N = 3 , A = 1 , B = 2 ; Console . WriteLine ( " Vertex ▁ = ▁ " + vertices ( N , A , B ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int factorial ( int n ) { int f = 1 ; for ( int i = 1 ; i <= n ; i ++ ) { f *= i ; } return f ; } static int sumFactorial ( int [ ] arr , int n ) { int s = 0 ; for ( int i = 0 ; i < n ; i ++ ) { s += factorial ( arr [ i ] ) ; } return s ; } public static void Main ( ) { int [ ] arr = { 7 , 3 , 5 , 4 , 8 } ; int n = arr . Length ; Console . WriteLine ( sumFactorial ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: f, i, s
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int ans = 0 ; static List < List < int > > gr = new List < List < int > > ( ) ; static void Add_Edge ( int u , int v ) { gr [ u ] . Add ( v ) ; gr [ v ] . Add ( u ) ; } static void dfs ( int child , int par , int [ ] color ) { if ( color [ child ] != color [ par ] ) ans ++ ; for ( int i = 0 ; i < gr [ child ] . Count ; i ++ ) { if ( gr [ child ] [ i ] == par ) continue ; dfs ( gr [ child ] [ i ] , child , color ) ; } } public static void Main ( String [ ] args ) { for ( int i = 0 ; i <= 10 ; i ++ ) gr . Add ( new List < int > ( ) ) ; int [ ] color = { 0 , 1 , 2 , 3 , 2 , 2 , 3 } ; Add_Edge ( 1 , 2 ) ; Add_Edge ( 1 , 3 ) ; Add_Edge ( 2 , 4 ) ; Add_Edge ( 2 , 5 ) ; Add_Edge ( 3 , 6 ) ; dfs ( 1 , 0 , color ) ; Console . WriteLine ( ans ) ; } }

Index/key variables: child, i, par, u, v
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int highestPower ( String str , int len ) { int ans = 0 ; for ( int i = len - 1 ; i >= 0 ; i -- ) { if ( str [ i ] == '0' ) ans ++ ; else break ; } return ans ; } public static void Main ( String [ ] args ) { String str = "100100" ; int len = str . Length ; Console . WriteLine ( highestPower ( str , len ) ) ; } }

Index/key variables: i
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static long mod = ( long ) ( 1e9 + 7 ) ; static long factorial ( long n , long p ) { for ( int i = 2 ; i <= n ; i ++ ) res = ( res * i ) % p ; return res ; } static long power ( long x , long y , long p ) { while ( y > 0 ) { if ( ( y & 1 ) == 1 ) res = ( res * x ) % p ; x = ( x * x ) % p ; } return res ; } static long modInverse ( long n , long p ) { return power ( n , p - 2 , p ) ; } static long nCrModP ( long n , long r , long p ) { if ( r == 0 ) return 1 ; long [ ] fac = new long [ ( int ) n + 1 ] ; fac [ 0 ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) fac [ i ] = fac [ i - 1 ] * i % p ; return ( fac [ ( int ) n ] * modInverse ( fac [ ( int ) r ] , p ) % p * modInverse ( fac [ ( int ) n - ( int ) r ] , p ) % p ) % p ; } static long countArrangements ( long n , long k , long p ) { return ( factorial ( n , p ) * nCrModP ( k , n , p ) ) % p ; } public static void Main ( ) { long N = 5 , K = 8 ; Console . WriteLine ( countArrangements ( N , K , mod ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int maxProd ( int N ) { if ( N == 0 ) return 1 ; if ( N < 10 ) return N ; return Math . Max ( maxProd ( N / 10 ) * ( N % 10 ) , maxProd ( N / 10 - 1 ) * 9 ) ; } static public void Main ( ) { int N = 390 ; Console . WriteLine ( maxProd ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int N = 2 ; static int M = 3 ; static bool check ( int [ , ] mat ) { int xorr = 0 ; for ( int i = 0 ; i < N ; i ++ ) { xorr ^= mat [ i , 0 ] ; } if ( xorr != 0 ) return true ; for ( int i = 0 ; i < N ; i ++ ) { for ( int j = 1 ; j < M ; j ++ ) { if ( mat [ i , j ] != mat [ i , 0 ] ) return true ; } } return false ; } static void Main ( ) { int [ , ] mat = { { 7 , 7 , 7 } , { 10 , 10 , 7 } } ; if ( check ( mat ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: i, j, xorr
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int sumodd ( int n ) { return ( n * n ) ; } static int sumeven ( int n ) { return ( n * ( n + 1 ) ) ; } static int findSum ( int num ) { int sumo = 0 ; int sume = 0 ; int x = 1 ; int cur = 0 ; int ans = 0 ; while ( num > 0 ) { int inc = Math . Min ( x , num ) ; num -= inc ; if ( cur == 0 ) { ans = ans + sumodd ( sumo + inc ) - sumodd ( sumo ) ; sumo += inc ; } else { ans = ans + sumeven ( sume + inc ) - sumeven ( sume ) ; sume += inc ; } x *= 2 ; cur ^= 1 ; } return ans ; } public static void Main ( String [ ] args ) { int n = 4 ; Console . WriteLine ( findSum ( n ) ) ; } }

Accumulator variables: cur, num, sume, sumo, x
Class/struct names: GFG
C# program:
using System ; class GFG { static int oddTriangularNumber ( int N ) { return ( N * ( ( 2 * N ) - 1 ) ) ; } public static void Main ( String [ ] args ) { int N = 3 ; Console . WriteLine ( oddTriangularNumber ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void idstrt ( double a1 , double b1 , double c1 , double a2 , double b2 , double c2 ) { if ( ( a1 / a2 == b1 / b2 ) && ( a1 / a2 == c1 / c2 ) && ( b1 / b2 == c1 / c2 ) ) Console . WriteLine ( " The ▁ given ▁ straight " + " ▁ lines ▁ are ▁ identical " ) ; else Console . WriteLine ( " The ▁ given ▁ straight " + " ▁ lines ▁ are ▁ not ▁ identical " ) ; } public static void Main ( String [ ] args ) { double a1 = - 2 , b1 = 4 , c1 = 3 , a2 = - 6 , b2 = 12 , c2 = 9 ; idstrt ( a1 , b1 , c1 , a2 , b2 , c2 ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static long MAXN = 100001L , mod = 1000000007L ; static long [ ] spf = new long [ ( int ) MAXN ] ; static Dictionary < long , long > cnt = new Dictionary < long , long > ( ) ; public static void sieve ( ) { spf [ 1 ] = 1 ; for ( int i = 2 ; i < MAXN ; i ++ ) spf [ i ] = i ; for ( int i = 4 ; i < MAXN ; i += 2 ) spf [ i ] = 2 ; for ( int i = 3 ; i * i < MAXN ; i ++ ) { if ( spf [ i ] == i ) { for ( int j = i * i ; j < MAXN ; j += i ) if ( spf [ j ] == j ) spf [ j ] = i ; } } } public static void factorize ( long f ) { while ( f > 1 ) { long x = spf [ ( int ) f ] ; while ( f % x == 0 ) { if ( cnt . ContainsKey ( x ) ) { long z = cnt [ x ] ; cnt [ x ] = ++ z ; } else cnt . Add ( x , ( long ) 1 ) ; f /= x ; } } } public static long factorial ( long n , long p ) { long res = 1 ; for ( long i = 2 ; i <= n ; i ++ ) res = ( res * i ) % p ; return res ; } public static long power ( long x , long y , long p ) { long res = 1 ; x = x % p ; while ( y > 0 ) { if ( y % 2 == 1 ) res = ( res * x ) % p ; y = y >> 1 ; x = ( x * x ) % p ; } return res ; } public static long modInverse ( long n , long p ) { return power ( n , p - 2 , p ) ; } public static long nCrModP ( long n , long r , long p ) { if ( r == 0 ) return 1 ; long [ ] fac = new long [ ( int ) n + 1 ] ; fac [ 0 ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) fac [ i ] = fac [ i - 1 ] * i % p ; return ( fac [ ( int ) n ] * modInverse ( fac [ ( int ) r ] , p ) % p * modInverse ( fac [ ( int ) ( n - r ) ] , p ) % p ) % p ; } public static long countArrays ( long [ ] arr , long N , long K , long P ) { long res = 1 ; sieve ( ) ; for ( int i = 0 ; i < N ; i ++ ) { factorize ( arr [ i ] ) ; } foreach ( KeyValuePair < long , long > entry in cnt ) { long ci = entry . Value ; res = ( res * nCrModP ( ci + K - 1 , K - 1 , P ) ) % P ; } return res ; } public static void Main ( String [ ] args ) { long [ ] arr = { 1 , 3 , 5 , 2 } ; long K = 3 ; long N = arr . Length ; Console . WriteLine ( countArrays ( arr , N , K , mod ) ) ; } }

Index/key variables: i, j, x
Accumulator variables: f, i, j
Iterator variables: entry, i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAXN = 100000 ; static int MOD = 1000000007 ; static long [ ] fact = new long [ MAXN ] ; static void factorial ( ) { fact [ 0 ] = 1 ; for ( int i = 1 ; i < MAXN ; i ++ ) fact [ i ] = ( fact [ i - 1 ] * i ) % MOD ; } static long power ( long x , long y , long p ) { while ( y > 0 ) { if ( y % 2 == 1 ) res = ( res * x ) % p ; x = ( x * x ) % p ; } return res ; } static long modInverse ( long x , long p ) { return power ( x , p - 2 , p ) ; } static long countDifferentNumbers ( long [ ] arr , long P ) { factorial ( ) ; long res = 0 , X = 0 ; for ( int i = 0 ; i < 10 ; i ++ ) X += arr [ i ] ; res = fact [ ( int ) X ] ; for ( int i = 0 ; i < 10 ; i ++ ) { if ( arr [ i ] > 1 ) res = ( res * modInverse ( fact [ ( int ) arr [ i ] ] , P ) ) % P ; } return res ; } public static void Main ( String [ ] args ) { long [ ] arr = { 1 , 0 , 2 , 0 , 0 , 7 , 4 , 0 , 0 , 3 } ; Console . WriteLine ( countDifferentNumbers ( arr , MOD ) ) ; } }

Index/key variables: MAXN, i
Accumulator variables: X, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void line ( double x0 , double y0 ) { double c = ( int ) ( 2 * y0 * x0 ) ; Console . WriteLine ( y0 + " x " + " ▁ + ▁ " + x0 + " y ▁ = ▁ " + c ) ; } public static void Main ( String [ ] args ) { double x0 = 4 , y0 = 3 ; line ( x0 , y0 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int N = 3 ; static int M = 7 ; static void printOriginalMatrix ( int [ ] a , int [ ] b , int [ , ] mat ) { for ( int i = 0 ; i < N ; i ++ ) { for ( int j = 0 ; j < M ; j ++ ) { if ( mat [ i , j ] == 1 ) Console . Write ( Math . Min ( a [ i ] , b [ j ] ) + " ▁ " ) ; else Console . Write ( "0" + " ▁ " ) ; } Console . WriteLine ( ) ; } } public static void Main ( ) { int [ ] a = { 2 , 1 , 3 } ; int [ ] b = { 2 , 3 , 0 , 0 , 2 , 0 , 1 } ; int [ , ] mat = { { 1 , 0 , 0 , 0 , 1 , 0 , 0 } , { 0 , 0 , 0 , 0 , 0 , 0 , 1 } , { 1 , 1 , 0 , 0 , 0 , 0 , 0 } } ; printOriginalMatrix ( a , b , mat ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static float percent ( int n , int x ) { float p = n * x ; p /= 100 ; return p ; } static float getLoss ( int [ ] price , int [ ] quantity , int [ ] X , int n ) { float loss = 0 ; for ( int i = 0 ; i < n ; i ++ ) { float originalPrice = price [ i ] ; float sellingPrice = originalPrice + percent ( ( int ) originalPrice , X [ i ] ) ; float afterDiscount = sellingPrice - percent ( ( int ) sellingPrice , X [ i ] ) ; loss += ( ( originalPrice - afterDiscount ) * quantity [ i ] ) ; } return loss ; } public static void Main ( ) { int [ ] price = { 20 , 48 , 200 , 100 } ; int [ ] quantity = { 20 , 48 , 1 , 1 } ; int [ ] X = { 0 , 48 , 200 , 5 } ; int n = X . Length ; Console . Write ( getLoss ( price , quantity , X , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, loss, p
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int maxAbsDiff ( int [ ] arr , int n ) { int minEle = arr [ 0 ] ; int maxEle = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { minEle = Math . Min ( minEle , arr [ i ] ) ; maxEle = Math . Max ( maxEle , arr [ i ] ) ; } return ( maxEle - minEle ) ; } public static void Main ( ) { int [ ] arr = { 2 , 1 , 5 , 3 } ; int n = arr . Length ; Console . WriteLine ( maxAbsDiff ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int maxSubArraySum ( int [ ] a , int size ) { int max_so_far = int . MinValue , max_ending_here = 0 ; for ( int i = 0 ; i < size ; i ++ ) { max_ending_here = max_ending_here + a [ i ] ; if ( max_so_far < max_ending_here ) max_so_far = max_ending_here ; if ( max_ending_here < 0 ) max_ending_here = 0 ; } return max_so_far ; } static int maximizeSum ( int [ ] a , int n ) { int cnt = 0 ; int mini = int . MaxValue ; int minSubarray = int . MaxValue ; int sum = maxSubArraySum ( a , n ) ; int max_so_far = int . MinValue , max_ending_here = 0 ; for ( int i = 0 ; i < n ; i ++ ) { max_ending_here = max_ending_here + a [ i ] ; cnt ++ ; minSubarray = Math . Min ( a [ i ] , minSubarray ) ; if ( sum == max_ending_here ) { if ( cnt == 1 ) mini = Math . Min ( mini , 0 ) ; else mini = Math . Min ( mini , minSubarray ) ; } if ( max_ending_here < 0 ) { max_ending_here = 0 ; cnt = 0 ; minSubarray = int . MaxValue ; } } return sum - mini ; } public static void Main ( String [ ] args ) { int [ ] a = { 1 , 2 , 3 , - 2 , 3 } ; int n = a . Length ; Console . WriteLine ( maximizeSum ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: cnt, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isOsiris ( int n ) { int a = n % 10 ; int b = ( n / 10 ) % 10 ; int c = n / 100 ; int digit_sum = a + b + c ; if ( n == ( 2 * ( digit_sum ) * 11 ) ) { return true ; } return false ; } static void Main ( ) { int n = 132 ; if ( isOsiris ( n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isDudeney ( int n ) { int cube_rt = ( int ) ( Math . Round ( ( Math . Pow ( n , 1.0 / 3.0 ) ) ) ) ; if ( cube_rt * cube_rt * cube_rt != n ) return false ; int dig_sum = 0 ; int temp = n ; while ( temp > 0 ) { int rem = temp % 10 ; dig_sum += rem ; temp /= 10 ; } if ( cube_rt != dig_sum ) return false ; return true ; } public static void Main ( ) { int n = 17576 ; if ( isDudeney ( n ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: dig_sum, temp
Class/struct names: GFG
C# program:
using System ; class GFG { static int countTriangles ( int [ ] a , int n ) { int cnt = 0 ; int pairs = 0 ; for ( int i = n - 1 ; i >= 0 ; i -- ) { pairs += a [ i ] / 2 ; if ( a [ i ] % 2 == 1 && pairs > 0 ) { cnt += 1 ; pairs -= 1 ; } } cnt += ( 2 * pairs ) / 3 ; return cnt ; } public static void Main ( ) { int [ ] a = { 1 , 2 , 2 , 2 , 2 } ; int n = a . Length ; Console . WriteLine ( countTriangles ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: cnt, i, pairs
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int smallestMultiple ( int n ) { if ( n == 1 ) return 5 ; return ( int ) ( Math . Pow ( 10 , n - 1 ) ) ; } public static void Main ( ) { int n = 4 ; Console . Write ( smallestMultiple ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int getHCF ( int x , int y ) { int minimum = Math . Min ( x , y ) ; if ( x % minimum == 0 && y % minimum == 0 ) return minimum ; for ( int i = minimum / 2 ; i >= 2 ; i -- ) { if ( x % i == 0 && y % i == 0 ) return i ; } return 1 ; } static void Main ( ) { int x = 16 , y = 32 ; Console . WriteLine ( getHCF ( x , y ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; 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 isDivisible ( int n ) { if ( isPrime ( n + 1 ) ) return false ; return true ; } static void Main ( ) { int n = 6 ; if ( isDivisible ( n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int R = 5 ; static int C = 5 ; static int findMaxCock ( int [ , ] ar ) { if ( R < 3 C < 3 ) return - 1 ; int max_sum = int . MinValue ; for ( int i = 0 ; i < R - 2 ; i ++ ) { for ( int j = 0 ; j < C - 2 ; j ++ ) { int sum = ( ar [ i , j ] + ar [ i , j + 2 ] ) + ( ar [ i + 1 , j + 1 ] ) + ( ar [ i + 2 , j ] + ar [ i + 2 , j + 1 ] + ar [ i + 2 , j + 2 ] ) ; max_sum = Math . Max ( max_sum , sum ) ; } } return max_sum ; } public static void Main ( ) { int [ , ] ar = { { 0 , 3 , 0 , 6 , 0 } , { 0 , 1 , 1 , 0 , 0 } , { 1 , 1 , 1 , 0 , 0 } , { 0 , 0 , 2 , 0 , 1 } , { 0 , 2 , 0 , 1 , 3 } } ; Console . WriteLine ( findMaxCock ( ar ) ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public static int segments ( int n , int [ ] p , int m ) { Dictionary < int , int > c = new Dictionary < int , int > ( ) ; c . Add ( 0 , 1 ) ; bool has = false ; int sum = 0 ; int ans = 0 ; for ( int r = 0 ; r < n ; r ++ ) { if ( p [ r ] < m ) sum -- ; else if ( p [ r ] > m ) sum ++ ; if ( p [ r ] == m ) has = true ; if ( has ) ans += ( ! c . ContainsKey ( sum ) ? 0 : c [ sum ] ) + ( ! c . ContainsKey ( sum - 1 ) ? 0 : c [ sum - 1 ] ) ; else c . Add ( sum , ! c . ContainsKey ( sum ) ? 1 : c [ sum ] + 1 ) ; } return ans ; } public static void Main ( String [ ] args ) { int [ ] a = { 2 , 4 , 5 , 3 , 1 } ; int n = a . Length ; int m = 4 ; Console . WriteLine ( segments ( n , a , m ) ) ; } }

Index/key variables: r, sum
Accumulator variables: ans, r, sum
Iterator variables: r
Boolean variables: has
Class/struct names: GFG
C# program:
using System ; class GFG { static int oddDays ( int N ) { int hund1 = N / 100 ; int hund4 = N / 400 ; int leap = N >> 2 ; int ord = N - leap ; if ( hund1 > 0 ) { ord += hund1 ; leap -= hund1 ; } if ( hund4 > 0 ) { ord -= hund4 ; leap += hund4 ; } int days = ord + leap * 2 ; int odd = days % 7 ; return odd ; } static void Main ( ) { int N = 100 ; Console . WriteLine ( oddDays ( N ) ) ; } }

Accumulator variables: leap, ord
Class/struct names: GFG
C# program:
using System ; class GFG { static float ellipsearea ( float r ) { if ( r < 0 ) return - 1 ; float a = ( float ) ( ( 3.14 * r * r ) / 4 ) ; return a ; } public static void Main ( ) { float r = 5 ; Console . WriteLine ( ellipsearea ( r ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Linq ; using System . Collections . Generic ; class GFG { static int minOperations ( int [ ] arr , int n ) { 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 maxFreq = int . MinValue ; maxFreq = m . Values . Max ( ) ; return ( n - maxFreq ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 2 , 4 , 6 } ; int n = arr . Length ; Console . WriteLine ( minOperations ( arr , n ) ) ; } }

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

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; class GfG { static int countCon ( int [ ] ar , int n ) { int cnt = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( ar [ i ] == ar [ i + 1 ] ) cnt ++ ; } return cnt ; } public static void Main ( ) { int [ ] ar = { 1 , 2 , 2 , 3 , 4 , 4 , 5 , 5 , 5 , 5 } ; int n = ar . Length ; Console . WriteLine ( countCon ( ar , n ) ) ; } }

Index/key variables: i
Accumulator variables: cnt, i
Iterator variables: i
Class/struct names: GfG