dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static int countSubSeq ( int [ ] arr , int n , int k ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] % k == 0 ) { count ++ ; } } return ( int ) ( Math . Pow ( 2 , count ) - 1 ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 3 , 6 } ; int n = arr . Length ; int k = 3 ; Console . WriteLine ( countSubSeq ( arr , n , k ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 1000001 ; static int countNum ( int N , int K ) { int [ ] sumPF = new int [ MAX ] ; for ( int i = 2 ; i < N ; i ++ ) { if ( sumPF [ i ] == 0 ) { for ( int j = i ; j < N ; j += i ) { sumPF [ j ] += i ; } } } int count = 0 ; for ( int i = 2 ; i < N ; i ++ ) { if ( sumPF [ i ] == K ) count ++ ; } return count ; } public static void Main ( String [ ] args ) { int N = 20 , K = 7 ; Console . WriteLine ( countNum ( N , K ) ) ; } }

Index/key variables: MAX, i, j
Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 100000 ; static bool [ ] prime = new bool [ MAX + 1 ] ; static void SieveOfEratosthenes ( ) { for ( int i = 0 ; i < MAX + 1 ; i ++ ) { prime [ i ] = true ; } for ( int p = 2 ; p * p <= MAX ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * p ; i <= MAX ; i += p ) prime [ i ] = false ; } } } static int smallestPrime ( int d ) { int l = ( int ) Math . Pow ( 10 , d - 1 ) ; int r = ( int ) Math . Pow ( 10 , d ) - 1 ; for ( int i = l ; i <= r ; i ++ ) { if ( prime [ i ] ) { return i ; } } return - 1 ; } static int largestPrime ( int d ) { int l = ( int ) Math . Pow ( 10 , d - 1 ) ; int r = ( int ) Math . Pow ( 10 , d ) - 1 ; for ( int i = r ; i >= l ; i -- ) { if ( prime [ i ] ) { return i ; } } return - 1 ; } public static void Main ( String [ ] args ) { SieveOfEratosthenes ( ) ; int [ ] queries = { 2 , 5 } ; int q = queries . Length ; for ( int i = 0 ; i < q ; i ++ ) { Console . WriteLine ( smallestPrime ( queries [ i ] ) + " ▁ " + largestPrime ( queries [ i ] ) ) ; } } }

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 printMatrix ( int n , int k ) { for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( i == j ) Console . Write ( k + " ▁ " ) ; else Console . Write ( "0 ▁ " ) ; } Console . Write ( " STRNEWLINE " ) ; } } public static void Main ( String [ ] args ) { int n = 3 , k = 7 ; printMatrix ( n , k ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public static bool possible ( int n ) { if ( n > 3 ) { int sum = ( n * ( n + 1 ) ) / 2 ; if ( sum % 3 == 0 ) { return true ; } } return false ; } static public void Main ( ) { int n = 5 ; if ( possible ( n ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int findNthNumber ( int A , int B , int N ) { int sum = 0 ; for ( int i = 2 ; i < N ; i ++ ) { sum = A + B ; A = B ; B = sum ; } return sum ; } public static void Main ( ) { int A = 5 , B = 7 , N = 10 ; Console . WriteLine ( findNthNumber ( A , B , N ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static void checkType ( int [ ] arr , int n ) { if ( arr [ 0 ] <= arr [ 1 ] && arr [ n - 2 ] <= arr [ n - 1 ] ) Console . Write ( " Increasing " ) ; else if ( arr [ 0 ] >= arr [ 1 ] && arr [ n - 2 ] >= arr [ n - 1 ] ) Console . Write ( " Decreasing " ) ; else if ( arr [ 0 ] <= arr [ 1 ] && arr [ n - 2 ] >= arr [ n - 1 ] ) Console . Write ( " Increasing ▁ then ▁ decreasing " ) ; else Console . Write ( " Decreasing ▁ then ▁ increasing " ) ; } static public void Main ( ) { int [ ] arr = new int [ ] { 1 , 2 , 3 , 4 } ; int n = arr . Length ; checkType ( arr , n ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static void cal_IST ( int h , double r ) { double IST = ( h * r * 1.0 ) / 360 ; int int_IST = ( int ) IST ; int float_IST = ( int ) Math . Floor ( ( double ) ( IST - int_IST ) * 60 ) ; Console . WriteLine ( int_IST + " : " + float_IST ) ; } public static void Main ( String [ ] args ) { int h = 20 ; double r = 150 ; cal_IST ( h , r ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPossible ( int [ ] arr , int p , int n , int m ) { int sum = 0 ; for ( int i = 0 ; i < p ; i ++ ) sum += arr [ i ] ; if ( sum == ( n * m ) ) return true ; return false ; } public static void Main ( String [ ] args ) { int n = 3 , m = 4 ; int [ ] arr = { 6 , 3 , 2 , 1 } ; int p = arr . Length ; if ( isPossible ( arr , p , n , m ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MinStep ( int [ ] a , int n ) { int positive = 0 , negative = 0 , zero = 0 ; int step = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] == 0 ) { zero ++ ; } else if ( a [ i ] < 0 ) { negative ++ ; step = step + ( - 1 - a [ i ] ) ; } else { positive ++ ; step = step + ( a [ i ] - 1 ) ; } } if ( negative % 2 == 0 ) { step = step + zero ; } else { if ( zero > 0 ) { step = step + zero ; } else { step = step + 2 ; } } return step ; } static public void Main ( ) { int [ ] a = { 0 , - 2 , - 1 , - 3 , 4 } ; int n = a . Length ; Console . Write ( MinStep ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, negative, positive, zero
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int sum ( int n ) { int sum = 0 ; while ( n > 0 ) { sum = sum + n % 10 ; n = n / 10 ; } return sum ; } static void firstN ( int n ) { int num = 19 , cnt = 1 ; while ( cnt != n ) { if ( sum ( num ) == 10 ) { Console . Write ( num + " ▁ " ) ; cnt ++ ; } num += 9 ; } } public static void Main ( String [ ] args ) { int n = 10 ; firstN ( n ) ; } }

Accumulator variables: cnt, num
Class/struct names: GFG
C# program:
using System ; class GFG { static long sumOfLastDig ( long n , long m ) { long sum = 0 , k ; k = n / m ; long [ ] arr = new long [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) { arr [ i ] = m * ( i + 1 ) % 10 ; sum += arr [ i ] ; } long rem = k % 10 ; long ans = ( k / 10 ) * sum ; for ( int i = 0 ; i < rem ; i ++ ) { ans += arr [ i ] ; } return ans ; } static public void Main ( ) { long n = 100 , m = 3 ; Console . Write ( sumOfLastDig ( n , m ) ) ; } }

Index/key variables: i
Accumulator variables: ans, i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public class pair { public int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static pair countSum ( int [ ] arr , int n ) { int NumberOfOdds = 0 , NumberOfEvens = 0 ; for ( int i = 0 ; i < n ; i ++ ) if ( arr [ i ] % 2 == 1 ) NumberOfOdds ++ ; NumberOfEvens = n - NumberOfOdds ; int NumberOfOddSubsequences = ( 1 << NumberOfEvens ) * ( 1 << ( NumberOfOdds - 1 ) ) ; int NumberOfEvenSubsequences = ( 1 << n ) - 1 - NumberOfOddSubsequences ; return new pair ( NumberOfEvenSubsequences , NumberOfOddSubsequences ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 2 , 3 } ; int n = arr . Length ; pair ans = countSum ( arr , n ) ; Console . Write ( " EvenSum ▁ = ▁ " + ans . first ) ; Console . Write ( " ▁ OddSum ▁ = ▁ " + ans . second ) ; } }

Index/key variables: i
Accumulator variables: NumberOfOdds, i
Iterator variables: i
Class/struct names: GFG, pair
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 int nextPrime ( int N ) { if ( N <= 1 ) return 2 ; int prime = N ; bool found = false ; while ( ! found ) { prime ++ ; if ( isPrime ( prime ) ) found = true ; } return prime ; } public static void Main ( String [ ] args ) { int N = 3 ; Console . WriteLine ( nextPrime ( N ) ) ; } }

Accumulator variables: prime
Iterator variables: i
Boolean variables: found
Class/struct names: GFG
C# program:
using System ; class GFG { static bool Survives ( int n ) { for ( int i = 2 ; ; i ++ ) { if ( i > n ) return true ; if ( n % i == 0 ) return false ; n -= n / i ; } } public static void Main ( String [ ] args ) { int n = 17 ; if ( Survives ( n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: i, n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int nthXorFib ( int n , int a , int b ) { if ( n == 0 ) return a ; if ( n == 1 ) return b ; if ( n == 2 ) return ( a ^ b ) ; return nthXorFib ( n % 3 , a , b ) ; } public static void Main ( String [ ] args ) { int a = 1 , b = 2 , n = 10 ; Console . WriteLine ( nthXorFib ( n , a , b ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int gcd ( int a , int b ) { if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } static void flip ( int a , int b ) { int lcm = ( a * b ) / gcd ( a , b ) ; a = lcm / a ; b = lcm / b ; Console . WriteLine ( ( a - 1 ) + " ▁ " + ( b - 1 ) ) ; } public static void Main ( ) { int a = 10 ; int b = 5 ; flip ( a , b ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void find_Solution ( double x , int n ) { double sum = x , e = 2 , o = 1 , p = 1 ; for ( int i = 2 ; i <= n ; i ++ ) { p += 2 ; sum += ( double ) ( o / e ) * ( double ) ( Math . Pow ( x , p ) / p ) ; o = o * ( o + 2 ) ; e = e * ( e + 2 ) ; } Console . WriteLine ( sum ) ; } public static void Main ( String [ ] args ) { double x = - 0.5 ; if ( Math . Abs ( x ) >= 1 ) { Console . WriteLine ( " Invalid ▁ Input " ) ; } int n = 8 ; find_Solution ( x , n ) ; } }

Accumulator variables: i, p, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int totalPay ( int totalItems , int priceOfOneItem , int N , int M ) { int freeItems = 0 , actual = 0 ; freeItems = totalItems / ( N + M ) ; actual = totalItems - freeItems ; int amount = actual * priceOfOneItem ; return amount ; } public static void Main ( String [ ] args ) { int T = 12 , P = 8 ; int N = 2 , M = 1 ; Console . Write ( " Amount ▁ = ▁ " + totalPay ( T , P , N , M ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int p = 1000000007 ; static long power ( long x , long y ) { 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 % p ; } static public void Main ( ) { long n = 3 ; long x = ( power ( 3 , n ) % p + 1 ) % p ; x = ( x - power ( 2 , n + 1 ) + p ) % p ; x = ( x * power ( 2 , p - 2 ) ) % p ; Console . Write ( x ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int rightmostNonZero ( int [ ] a , int n ) { int c5 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { while ( a [ i ] > 0 && a [ i ] % 5 == 0 ) { a [ i ] /= 5 ; c5 ++ ; } } for ( int i = 0 ; i < n ; i ++ ) { while ( c5 != 0 && a [ i ] > 0 && ( a [ i ] & 1 ) == 0 ) { a [ i ] >>= 1 ; c5 -- ; } } int ans = 1 ; for ( int i = 0 ; i < n ; i ++ ) { ans = ( ans * a [ i ] % 10 ) % 10 ; } if ( c5 != 0 ) ans = ( ans * 5 ) % 10 ; if ( ans != 0 ) return ans ; return - 1 ; } public static void Main ( ) { int [ ] a = { 7 , 42 , 11 , 64 } ; int n = a . Length ; Console . WriteLine ( rightmostNonZero ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: c5, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findRemainder ( int n ) { int l = n % 10 ; while ( n >= 10 ) n /= 10 ; int f = n ; int remainder = f % l ; Console . WriteLine ( remainder ) ; } public static void Main ( ) { int n = 5223 ; findRemainder ( n ) ; } }

Accumulator variables: n
Class/struct names: GFG
C# program:
using System ; class GFG { static double increaseInVol ( double l , double b , double h ) { double percentInc = ( 1 + ( l / 100 ) ) * ( 1 + ( b / 100 ) ) * ( 1 + ( h / 100 ) ) ; percentInc -= 1 ; percentInc *= 100 ; return percentInc ; } public static void Main ( ) { double l = 50 , b = 20 , h = 10 ; Console . WriteLine ( increaseInVol ( l , b , h ) + " % " ) ; } }

Accumulator variables: percentInc
Class/struct names: GFG
C# program:
using System ; class GFG { static int countOccurrances ( int n , int d ) { int count = 0 ; while ( n > 0 ) { count = ( n % 10 == d ) ? count + 1 : count ; n = n / 10 ; } return count ; } public static void Main ( ) { int d = 2 ; int n = 214215421 ; Console . WriteLine ( countOccurrances ( n , d ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void findFactors ( int a , int b ) { int c ; c = a + b - 1 ; Console . Write ( c ) ; } public static void Main ( String [ ] args ) { int a , b ; a = 13 ; b = 36 ; findFactors ( a , b ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void TwentyoneMatchstick ( int [ ] arr , int N ) { for ( int i = 0 ; i < N ; i += 1 ) { Console . Write ( 5 - arr [ i ] + " ▁ " ) ; } Console . Write ( " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 3 , 4 , 2 , 2 } ; int N = arr . Length ; TwentyoneMatchstick ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void expressDigit ( int [ ] arr , int n ) { int min = 9 , index = 0 , temp = 0 ; temp = arr [ 0 ] ; for ( int i = 1 ; i < 10 ; i ++ ) { if ( arr [ i ] < min ) { min = arr [ i ] ; index = i ; } } if ( temp < min ) { Console . Write ( 1 ) ; for ( int i = 1 ; i <= temp + 1 ; i ++ ) Console . Write ( 0 ) ; } else { for ( int i = 0 ; i < min ; i ++ ) Console . Write ( index ) ; Console . Write ( index ) ; } } public static void Main ( String [ ] args ) { int [ ] arr = { 2 , 2 , 1 , 2 , 1 , 1 , 3 , 1 , 1 , 1 } ; int N = 10 ; expressDigit ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static int countDigits ( int num ) { int cnt = 0 ; while ( num > 0 ) { cnt ++ ; num /= 10 ; } return cnt ; } public static int sumFromStart ( int num , int n , int rem ) { num /= ( ( int ) Math . Pow ( 10 , rem ) ) ; int sum = 0 ; while ( num > 0 ) { sum += ( num % 10 ) ; num /= 10 ; } return sum ; } public static int sumFromEnd ( int num , int n ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { sum += ( num % 10 ) ; num /= 10 ; } return sum ; } public static float getAverage ( int n , int k , int l ) { int totalDigits = countDigits ( n ) ; if ( totalDigits < ( k + l ) ) return - 1 ; int sum1 = sumFromEnd ( n , l ) ; int sum2 = sumFromStart ( n , k , totalDigits - k ) ; return ( ( float ) ( sum1 + sum2 ) / ( float ) ( k + l ) ) ; } public static void Main ( String [ ] args ) { int n = 123456 , k = 2 , l = 3 ; Console . WriteLine ( getAverage ( n , k , l ) ) ; } }

Accumulator variables: cnt, i, num, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int Wythoff ( Dictionary < int , Dictionary < int , int > > mp , int n , int k ) { double tau = ( Math . Sqrt ( 5 ) + 1 ) / 2.0 , t_n_k ; if ( mp . ContainsKey ( n ) && mp [ n ] . ContainsKey ( k ) && mp [ n ] [ k ] != 0 ) return mp [ n ] [ k ] ; if ( k == - 1 ) { return n - 1 ; } else if ( k == 0 ) { t_n_k = Math . Floor ( n * tau ) ; } else { t_n_k = Wythoff ( mp , n , k - 1 ) + Wythoff ( mp , n , k - 2 ) ; } if ( ! mp . ContainsKey ( n ) ) { mp [ n ] = new Dictionary < int , int > ( ) ; } mp [ n ] [ k ] = ( int ) t_n_k ; return ( int ) t_n_k ; } static void Wythoff_Array ( int n ) { int i = 0 , j = 0 , count = 0 ; Dictionary < int , Dictionary < int , int > > mp = new Dictionary < int , Dictionary < int , int > > ( ) ; while ( count < n ) { Console . Write ( Wythoff ( mp , i + 1 , j + 1 ) ) ; count ++ ; if ( count != n ) Console . Write ( " , ▁ " ) ; i ++ ; j -- ; if ( j < 0 ) { j = i ; i = 0 ; } } } static void Main ( ) { int n = 15 ; Wythoff_Array ( n ) ; } }

Index/key variables: k, n
Accumulator variables: count, i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static double sum ( double a , double b , double c , double d , double x ) { double ans = ( x * ( a + b ) * ( c - d ) ) / ( ( a * d ) - ( b * c ) ) ; return ans ; } public static void Main ( ) { double a = 1 , b = 2 , c = 9 , d = 13 , x = 5 ; Console . WriteLine ( sum ( a , b , c , d , x ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool is_Prime ( int n ) { if ( n < 2 ) return false ; for ( int i = 2 ; i <= Math . Sqrt ( n ) ; i ++ ) if ( n % i == 0 ) return false ; return true ; } static void set_primes ( Dictionary < int , Dictionary < int , int > > mp , Dictionary < int , Dictionary < int , int > > hash , int c ) { int count = 0 ; for ( int i = 2 ; count < c ; i ++ ) { if ( is_Prime ( i ) ) { if ( ! mp . ContainsKey ( 0 ) ) { mp [ 0 ] = new Dictionary < int , int > ( ) ; } if ( ! mp [ 0 ] . ContainsKey ( count ) ) { mp [ 0 ] . Add ( count , i ) ; } else { mp [ 0 ] [ count ] = i ; } count ++ ; if ( ! hash . ContainsKey ( 0 ) ) { hash [ 0 ] = new Dictionary < int , int > ( ) ; } if ( ! hash [ 0 ] . ContainsKey ( count - 1 ) ) { hash [ 0 ] . Add ( count - 1 , 1 ) ; } else { hash [ 0 ] [ count - 1 ] = 1 ; } } } } static int Gilbreath ( Dictionary < int , Dictionary < int , int > > mp , Dictionary < int , Dictionary < int , int > > hash , int n , int k ) { if ( hash . ContainsKey ( n ) && hash [ n ] . ContainsKey ( k ) && hash [ n ] [ k ] != 0 ) return mp [ n ] [ k ] ; int ans = Math . Abs ( Gilbreath ( mp , hash , n - 1 , k + 1 ) - Gilbreath ( mp , hash , n - 1 , k ) ) ; if ( ! mp . ContainsKey ( n ) ) { mp [ n ] = new Dictionary < int , int > ( ) ; } mp [ n ] [ k ] = ans ; return ans ; } static void solve ( int n ) { int i = 0 , j = 0 , count = 0 ; Dictionary < int , Dictionary < int , int > > mp = new Dictionary < int , Dictionary < int , int > > ( ) ; Dictionary < int , Dictionary < int , int > > hash = new Dictionary < int , Dictionary < int , int > > ( ) ; set_primes ( mp , hash , 100 ) ; while ( count < n ) { Console . Write ( Gilbreath ( mp , hash , i , j ) + " , ▁ " ) ; count ++ ; i -- ; j ++ ; if ( i < 0 ) { i = j ; j = 0 ; } } } static void Main ( ) { int n = 15 ; solve ( n ) ; } }

Index/key variables: count, k, n
Accumulator variables: count, i, j
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void printRoots ( long a , long b , long c ) { Console . WriteLine ( "1 , ▁ " + c / ( a * 1.0 ) ) ; } public static void Main ( ) { long a = 2 ; long b = 3 ; long c = - 5 ; printRoots ( a , b , c ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int longestAlternativeSequence ( int [ ] a , int n ) { int maxi1 = 0 ; int f1 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( f1 != 0 ) { if ( a [ i ] % 2 == 0 ) { f1 = 1 ; maxi1 ++ ; } } else { if ( a [ i ] % 2 == 0 ) { maxi1 ++ ; f1 = 0 ; } } } int maxi2 = 0 ; int f2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( f2 == 0 ) { if ( a [ i ] % 2 == 0 ) { f2 = 1 ; maxi2 ++ ; } } else { if ( a [ i ] % 2 == 0 ) { maxi2 ++ ; f2 = 0 ; } } } return Math . Max ( maxi1 , maxi2 ) ; } public static void Main ( ) { int [ ] a = { 13 , 16 , 8 , 9 , 32 , 10 } ; int n = a . Length ; Console . Write ( longestAlternativeSequence ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, maxi1, maxi2
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static String nambiarNumber ( String str , int i ) { if ( i >= str . Length ) return " " ; int firstDigit = ( str [ i ] - '0' ) ; int digitParity = firstDigit % 2 ; int sumDigits = 0 ; while ( i < str . Length ) { sumDigits += ( str [ i ] - '0' ) ; int sumParity = sumDigits % 2 ; if ( digitParity != sumParity ) { break ; } i ++ ; } return ( " " + sumDigits + nambiarNumber ( str , i + 1 ) ) ; } public static void Main ( String [ ] args ) { String str = "9880127431" ; Console . WriteLine ( nambiarNumber ( str , 0 ) ) ; } }

Index/key variables: i
Accumulator variables: i, sumDigits
Class/struct names: GFG
C# program:
using System ; class GFG { static float Depreciation ( float v , float r , float t ) { float D = ( float ) ( v * Math . Pow ( ( 1 - r / 100 ) , t ) ) ; return D ; } public static void Main ( ) { float V1 = 200 , R = 10 , T = 2 ; Console . WriteLine ( Depreciation ( V1 , R , T ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int phi ( int n ) { for ( int p = 2 ; p * p <= n ; ++ p ) { if ( n % p == 0 ) { while ( n % p == 0 ) n /= p ; result -= result / p ; } } if ( n > 1 ) result -= result / n ; return result ; } static void Highly_Totient ( int n ) { int count = 0 , p_count = - 1 , i ; Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; for ( i = 1 ; i < 100000 ; i ++ ) { if ( mp . ContainsKey ( phi ( i ) ) ) { mp [ phi ( i ) ] = mp [ phi ( i ) ] + 1 ; } else { mp . Add ( phi ( i ) , 1 ) ; } } i = 1 ; while ( count < n ) { if ( mp . ContainsKey ( i ) && mp [ i ] > p_count ) { Console . Write ( i ) ; if ( count < n - 1 ) Console . Write ( " , ▁ " ) ; p_count = mp [ i ] ; count ++ ; } i ++ ; } } public static void Main ( String [ ] args ) { int n = 20 ; Highly_Totient ( n ) ; } }

Index/key variables: i
Accumulator variables: count, i, n, result
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { static int speedOfTrain ( float X , float Y ) { float Speed ; Speed = 1188 * ( ( X - Y ) / Y ) ; return ( int ) Speed ; } public static void Main ( ) { float X = 8f , Y = 7.2f ; int result = ( speedOfTrain ( X , Y ) ) ; Console . Write ( result + " ▁ km / hr " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int Division ( int [ ] a , int n ) { int maxi = int . MinValue , mini = int . MaxValue ; for ( int i = 0 ; i < n ; i ++ ) { maxi = Math . Max ( a [ i ] , maxi ) ; mini = Math . Min ( a [ i ] , mini ) ; } return maxi / mini ; } public static void Main ( String [ ] args ) { int [ ] a = { 3 , 7 , 9 , 3 , 11 } ; int n = a . Length ; Console . WriteLine ( Division ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int CARDS = 100 ; static void currentRound ( List < int > list , int totalPiles ) { int i ; List < List < int > > piles = new List < List < int > > ( ) ; for ( i = 0 ; i < totalPiles ; i ++ ) piles . Add ( new List < int > ( ) ) ; int j = 0 ; for ( i = 0 ; i < CARDS ; i ++ ) { piles [ j ] . Add ( list [ i ] ) ; j = ( j + 1 ) % totalPiles ; } int pileNo = 0 ; i = 0 ; j = 0 ; while ( i < CARDS ) { list . Insert ( i , piles [ pileNo ] [ j ] ) ; j ++ ; if ( j >= piles [ pileNo ] . Count ) { pileNo ++ ; j = 0 ; } i ++ ; } } static int performRounds ( int [ ] piles , int rounds , int n ) { List < int > list = new List < int > ( ) ; for ( int i = 1 ; i <= CARDS ; i ++ ) list . Add ( i ) ; for ( int i = 0 ; i < rounds ; i ++ ) currentRound ( list , piles [ i ] ) ; return list [ n ] ; } public static void Main ( String [ ] args ) { int [ ] piles = { 2 , 2 } ; int rounds = piles . Length ; int n = 4 ; n -- ; Console . WriteLine ( performRounds ( piles , rounds , n ) ) ; } }

Index/key variables: i, j, n, pileNo
Accumulator variables: i, j, n, pileNo
Iterator variables: i
Class/struct names: GFG