dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static bool isValid ( long i , long m ) { long sq_i = ( long ) Math . Sqrt ( i ) ; long sq = Math . Min ( m , sq_i ) ; for ( long j = 2 ; j <= sq ; j ++ ) if ( i % j == 0 ) return false ; return true ; } static void findLargestNum ( long n , long m ) { for ( long i = n ; i > m ; i -- ) { if ( isValid ( i , m ) ) { Console . WriteLine ( i ) ; return ; } } Console . WriteLine ( " Number ▁ Doesn ' t ▁ Exists " ) ; } public static void Main ( ) { long n = 55 , m = 25 ; findLargestNum ( n , m ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPerfectSquare ( double x ) { if ( x >= 0 ) { double sr = Math . Sqrt ( x ) ; return ( sr * sr == x ) ; } return false ; } public static void Main ( ) { double x = 2502 ; if ( isPerfectSquare ( x ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void printGP ( int a , int r , int n ) { int curr_term ; for ( int i = 0 ; i < n ; i ++ ) { curr_term = a * ( int ) Math . Pow ( r , i ) ; Console . Write ( curr_term + " ▁ " ) ; } } public static void Main ( ) { int a = 2 ; int r = 3 ; int n = 5 ; printGP ( a , r , n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int gcd ( int a , int b ) { if ( a % b == 0 ) return b ; else return ( gcd ( b , a % b ) ) ; } static int findHcf ( int [ , ] arr , int size ) { int ans = arr [ 0 , 0 ] ; for ( int i = 1 ; i < size ; i ++ ) ans = gcd ( ans , arr [ i , 0 ] ) ; return ( ans ) ; } static int findLcm ( int [ , ] arr , int size ) { int ans = arr [ 0 , 1 ] ; for ( int i = 1 ; i < size ; i ++ ) ans = ( ( ( arr [ i , 1 ] * ans ) ) / ( gcd ( arr [ i , 1 ] , ans ) ) ) ; return ( ans ) ; } static int [ ] hcfOfFraction ( int [ , ] arr , int size ) { int hcf_of_num = findHcf ( arr , size ) ; int lcm_of_deno = findLcm ( arr , size ) ; int [ ] result = new int [ 2 ] ; result [ 0 ] = hcf_of_num ; result [ 1 ] = lcm_of_deno ; for ( int i = result [ 0 ] / 2 ; i > 1 ; i -- ) { if ( ( result [ 1 ] % i == 0 ) && ( result [ 0 ] % i == 0 ) ) { result [ 1 ] /= i ; result [ 0 ] /= i ; } } return ( result ) ; } public static void Main ( String [ ] args ) { int size = 4 ; int [ , ] arr = new int [ size , size ] ; arr [ 0 , 0 ] = 9 ; arr [ 0 , 1 ] = 10 ; arr [ 1 , 0 ] = 12 ; arr [ 1 , 1 ] = 25 ; arr [ 2 , 0 ] = 18 ; arr [ 2 , 1 ] = 35 ; arr [ 3 , 0 ] = 21 ; arr [ 3 , 1 ] = 40 ; int [ ] result = hcfOfFraction ( arr , size ) ; Console . WriteLine ( result [ 0 ] + " , ▁ " + result [ 1 ] ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int getMSB ( int n ) { n |= n >> 1 ; n |= n >> 2 ; n |= n >> 4 ; n |= n >> 8 ; n |= n >> 16 ; return ( ( n + 1 ) >> 2 ) ; } static void multiply ( int [ , ] F , int [ , ] M ) { int x = F [ 0 , 0 ] * M [ 0 , 0 ] + F [ 0 , 1 ] * M [ 1 , 0 ] ; int y = F [ 0 , 0 ] * M [ 0 , 1 ] + F [ 0 , 1 ] * M [ 1 , 1 ] ; int z = F [ 1 , 0 ] * M [ 0 , 0 ] + F [ 1 , 1 ] * M [ 1 , 0 ] ; int w = F [ 1 , 0 ] * M [ 0 , 1 ] + F [ 1 , 1 ] * M [ 1 , 1 ] ; F [ 0 , 0 ] = x ; F [ 0 , 1 ] = y ; F [ 1 , 0 ] = z ; F [ 1 , 1 ] = w ; } static void power ( int [ , ] F , int n ) { if ( n == 0 n == 1 ) return ; int [ , ] M = { { 1 , 1 } , { 1 , 0 } } ; for ( int m = getMSB ( n ) ; m > 0 ; m = m >> 1 ) { multiply ( F , F ) ; if ( ( n & m ) > 0 ) { multiply ( F , M ) ; } } } static int fib ( int n ) { int [ , ] F = { { 1 , 1 } , { 1 , 0 } } ; if ( n == 0 ) return 0 ; power ( F , n - 1 ) ; return F [ 0 , 0 ] ; } static public void Main ( ) { int n = 6 ; Console . WriteLine ( fib ( n ) ) ; } }

Accumulator variables: n
Iterator variables: m
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void SternSequenceFunc ( List < int > BrocotSequence , int n ) { for ( int i = 1 ; BrocotSequence . Count < n ; i ++ ) { int considered_element = BrocotSequence [ i ] ; int precedent = BrocotSequence [ i - 1 ] ; BrocotSequence . Add ( considered_element + precedent ) ; BrocotSequence . Add ( considered_element ) ; } for ( int i = 0 ; i < 15 ; ++ i ) Console . Write ( BrocotSequence [ i ] + " ▁ " ) ; } static void Main ( ) { int n = 15 ; List < int > BrocotSequence = new List < int > ( ) ; BrocotSequence . Add ( 1 ) ; BrocotSequence . Add ( 1 ) ; SternSequenceFunc ( BrocotSequence , n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isRevDiffDivisible ( int x , int k ) { int n = x ; int m = 0 ; while ( x > 0 ) { m = m * 10 + x % 10 ; x /= 10 ; } return ( Math . Abs ( n - m ) % k == 0 ) ; } static int countNumbers ( int l , int r , int k ) { int count = 0 ; for ( int i = l ; i <= r ; i ++ ) if ( isRevDiffDivisible ( i , k ) ) ++ count ; return count ; } public static void Main ( ) { int l = 35 , r = 45 , k = 5 ; Console . WriteLine ( countNumbers ( l , r , k ) ) ; } }

Accumulator variables: i, x
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int divSum ( int n ) { int result = 0 ; for ( int i = 2 ; i <= Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { if ( i == ( n / i ) ) result += i ; else result += ( i + n / i ) ; } } return ( result + 1 ) ; } static bool areAmicable ( int x , int y ) { if ( divSum ( x ) != y ) return false ; return ( divSum ( y ) == x ) ; } public static void Main ( ) { int x = 220 , y = 284 ; if ( areAmicable ( x , y ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: i, result
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPerfectSquare ( int n ) { if ( n < 0 ) return false ; double root = Math . Round ( ( double ) ( Math . Sqrt ( n ) ) ) ; return n == root * root ; } static void printnonsquare ( int n ) { int count = 0 ; for ( int i = 1 ; count < n ; ++ i ) { if ( ! isPerfectSquare ( i ) ) { Console . Write ( i + " ▁ " ) ; count ++ ; } } } static public void Main ( ) { int n = 10 ; printnonsquare ( n ) ; } }

Accumulator variables: count
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int nonsquare ( int n ) { return n + ( int ) ( 0.5 + ( Math . Sqrt ( n ) ) ) ; } static void printNonSquare ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) Console . Write ( nonsquare ( i ) + " ▁ " ) ; } public static void Main ( ) { int n = 10 ; printNonSquare ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections ; class GFG { public static ArrayList getLudic ( int n ) { ArrayList ludics = new ArrayList ( ) ; for ( int i = 1 ; i <= n ; i ++ ) ludics . Add ( i ) ; for ( int index = 1 ; index < ludics . Count ; index ++ ) { int first_ludic = ( int ) ludics [ index ] ; int remove_index = index + first_ludic ; while ( remove_index < ludics . Count ) { ludics . Remove ( ludics [ remove_index ] ) ; remove_index = remove_index + first_ludic - 1 ; } } return ludics ; } public static void Main ( string [ ] srgs ) { int n = 25 ; ArrayList tmp = getLudic ( n ) ; Console . Write ( " [ " ) ; foreach ( int x in tmp ) { Console . Write ( x + " , ▁ " ) ; } Console . Write ( " ] " ) ; } }

Index/key variables: index, remove_index
Accumulator variables: i, index
Iterator variables: i, index, x
Class/struct names: GFG
C# program:
using System ; class GFG { static void sieve ( int n , bool [ ] prime ) { for ( int p = 2 ; p * p <= n ; p ++ ) { if ( prime [ p ] == false ) { for ( int i = p * 2 ; i <= n ; i += p ) prime [ i ] = true ; } } } static void printPrimeTriplets ( int n ) { bool [ ] prime = new bool [ n + 1 ] ; sieve ( n , prime ) ; Console . WriteLine ( " The ▁ prime ▁ triplets ▁ " + " from ▁ 1 ▁ to ▁ " + n + " ▁ are ▁ : " ) ; for ( int i = 2 ; i <= n - 6 ; ++ i ) { if ( ! prime [ i ] && ! prime [ i + 2 ] && ! prime [ i + 6 ] ) Console . WriteLine ( i + " ▁ " + ( i + 2 ) + " ▁ " + ( i + 6 ) ) ; else if ( ! prime [ i ] && ! prime [ i + 4 ] && ! prime [ i + 6 ] ) Console . WriteLine ( i + " ▁ " + ( i + 4 ) + " ▁ " + ( i + 6 ) ) ; } } public static void Main ( ) { int n = 25 ; printPrimeTriplets ( n ) ; } }

Index/key variables: i, p
Accumulator variables: i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class Fraction { int num , den ; Fraction ( int n , int d ) { num = n ; den = d ; } static Fraction maxFraction ( Fraction first , Fraction sec ) { int a = first . num ; int b = first . den ; int c = sec . num ; int d = sec . den ; int Y = a * d - b * c ; return ( Y > 0 ) ? first : sec ; } public static void Main ( ) { Fraction first = new Fraction ( 3 , 2 ) ; Fraction sec = new Fraction ( 3 , 4 ) ; Fraction res = maxFraction ( first , sec ) ; Console . WriteLine ( res . num + " / " + res . den ) ; } }

Class/struct names: Fraction
C# program:
using System ; class GFG { static void nearestPerfectSquare ( int [ ] arr , int N ) { for ( int i = 0 ; i < N ; i ++ ) { int sr = ( int ) Math . Sqrt ( arr [ i ] ) ; if ( ( sr & 1 ) == ( arr [ i ] & 1 ) ) Console . Write ( ( sr * sr ) + " ▁ " ) ; else { sr ++ ; Console . Write ( ( sr * sr ) + " ▁ " ) ; } } } static public void Main ( ) { int [ ] arr = { 6 , 3 , 2 , 15 } ; int N = arr . Length ; nearestPerfectSquare ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i, sr
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPentagonal ( int N ) { int i = 1 , M ; do { M = ( 3 * i * i - i ) / 2 ; i += 1 ; } while ( M < N ) ; return ( M == N ) ; } public static void Main ( ) { int N = 12 ; if ( isPentagonal ( N ) ) Console . Write ( N + " ▁ is ▁ pentagonal ▁ " ) ; else Console . Write ( N + " ▁ is ▁ not ▁ pentagonal " ) ; } }

Accumulator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int unitnumber ( int x , int y ) { x = x % 10 ; if ( y != 0 ) y = y % 4 + 4 ; return ( ( ( int ) ( Math . Pow ( x , y ) ) ) % 10 ) ; } public static void Main ( ) { int x = 133 , y = 5 ; Console . WriteLine ( unitnumber ( x , y ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int aliquotSum ( int n ) { int sum = 0 ; for ( int i = 1 ; i < n ; i ++ ) if ( n % i == 0 ) sum += i ; return sum ; } public static void Main ( ) { int n = 12 ; Console . WriteLine ( aliquotSum ( n ) ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Text . RegularExpressions ; class GfG { public static String complexNumberMultiply ( String a , String b ) { String [ ] x = Regex . Split ( a , @"\+ i" ) ; String [ ] y = Regex . Split ( b , @"\+ i" ) ; int a_real = Int32 . Parse ( x [ 0 ] ) ; int a_img = Int32 . Parse ( x [ 1 ] ) ; int b_real = Int32 . Parse ( y [ 0 ] ) ; int b_img = Int32 . Parse ( y [ 1 ] ) ; return ( a_real * b_real - a_img * b_img ) + " + " + ( a_real * b_img + a_img * b_real ) + " i " ; } public static void Main ( String [ ] argc ) { String str1 = "1 + 1i " ; String str2 = "1 + 1i " ; Console . WriteLine ( complexNumberMultiply ( str1 , str2 ) ) ; } }

Class/struct names: GfG
C# program:
using System ; public class GFG { static float AvgofSquareN ( int n ) { return ( float ) ( ( n + 1 ) * ( 2 * n + 1 ) ) / 6 ; } static public void Main ( String [ ] args ) { int n = 2 ; Console . WriteLine ( AvgofSquareN ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float func ( float x ) { return ( 1 / ( 1 + x * x ) ) ; } static float calculate ( float lower_limit , float upper_limit , int interval_limit ) { float interval_size = ( upper_limit - lower_limit ) / interval_limit ; float sum = func ( lower_limit ) + func ( upper_limit ) ; for ( int i = 1 ; i < interval_limit ; i ++ ) { if ( i % 3 == 0 ) sum = sum + 2 * func ( lower_limit + i * interval_size ) ; else sum = sum + 3 * func ( lower_limit + i * interval_size ) ; } return ( 3 * interval_size / 8 ) * sum ; } public static void Main ( ) { int interval_limit = 10 ; float lower_limit = 1 ; float upper_limit = 10 ; float integral_res = calculate ( lower_limit , upper_limit , interval_limit ) ; Console . WriteLine ( integral_res ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static int maxArea ( int [ ] a ) { int Area = 0 ; for ( int i = 0 ; i < a . Length ; i ++ ) { for ( int j = i + 1 ; j < a . Length ; j ++ ) { Area = Math . Max ( Area , Math . Min ( a [ i ] , a [ j ] ) * ( j - i ) ) ; } } return Area ; } public static void Main ( String [ ] args ) { int [ ] a = { 1 , 5 , 4 , 3 } ; int [ ] b = { 3 , 1 , 2 , 4 , 5 } ; Console . WriteLine ( maxArea ( a ) ) ; Console . Write ( maxArea ( b ) ) ; } }

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 focal_length ( float image_distance , float object_distance ) { return 1 / ( ( 1 / image_distance ) + ( 1 / object_distance ) ) ; } public static void Main ( ) { float image_distance = 2 ; float object_distance = 50 ; Console . WriteLine ( " Focal ▁ length ▁ of ▁ a ▁ lens ▁ is ▁ " + focal_length ( image_distance , object_distance ) + " ▁ units . " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool check ( int n ) { int m = n ; while ( n != 0 ) { int r = n % 10 ; if ( r > 0 ) if ( ( m % r ) != 0 ) return false ; n /= 10 ; } return true ; } static int count ( int l , int r ) { int ans = 0 ; for ( int i = l ; i <= r ; i ++ ) if ( check ( i ) ) ans += 1 ; return ans ; } public static void Main ( ) { int l = 10 , r = 20 ; Console . WriteLine ( count ( l , r ) ) ; } }

Accumulator variables: ans, i, n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class demo { public static double sumOfTheSeries ( int n ) { double sum = 0.0 ; for ( int i = 1 ; i <= n ; i ++ ) sum += 1.0 / ( i * ( i + 1 ) ) ; return sum ; } public static void Main ( ) { int n = 10 ; Console . Write ( sumOfTheSeries ( n ) ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: demo
C# program:
using System ; class GFG { static long sum ( long n ) { long root = ( long ) Math . Sqrt ( n ) ; long ans = 0 ; for ( int i = 1 ; i <= root ; i ++ ) ans += n / i ; ans = 2 * ans - ( root * root ) ; return ans ; } public static void Main ( ) { long n = 35 ; Console . Write ( sum ( n ) ) ; } }

Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int sumOfTheSeries ( int n ) { int sum_n = ( n * ( n + 1 ) / 2 ) ; int sum_sq_n = ( n * ( n + 1 ) / 2 ) * ( 2 * n + 1 ) / 3 ; return ( sum_n + sum_sq_n ) ; } public static void Main ( ) { int n = 5 ; Console . Write ( " Sum ▁ = ▁ " + sumOfTheSeries ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int sumofsquare ( int n ) { int [ , ] C = new int [ n + 1 , n + 1 ] ; int i , j ; for ( i = 0 ; i <= n ; i ++ ) { for ( j = 0 ; j <= Math . Min ( i , n ) ; j ++ ) { if ( j == 0 j == i ) C [ i , j ] = 1 ; else C [ i , j ] = C [ i - 1 , j - 1 ] + C [ i - 1 , j ] ; } } int sum = 0 ; for ( i = 0 ; i <= n ; i ++ ) sum += ( C [ n , i ] * C [ n , i ] ) ; return sum ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( sumofsquare ( n ) ) ; } }

Accumulator variables: i, j, sum
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GfG { static int sumOfSeries ( int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) for ( int j = 1 ; j <= i ; j ++ ) sum = sum + i ; return sum ; } public static void Main ( ) { int n = 10 ; Console . Write ( sumOfSeries ( n ) ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GfG
C# program:
using System ; class GFG { static int evenSum ( int n ) { int [ , ] C = new int [ n + 1 , n + 1 ] ; int i , j ; for ( i = 0 ; i <= n ; i ++ ) { for ( j = 0 ; j <= Math . Min ( i , n ) ; j ++ ) { if ( j == 0 j == i ) C [ i , j ] = 1 ; else C [ i , j ] = C [ i - 1 , j - 1 ] + C [ i - 1 , j ] ; } } int sum = 0 ; for ( i = 0 ; i <= n ; i += 2 ) sum += C [ n , i ] ; return sum ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( evenSum ( n ) ) ; } }

Accumulator variables: i, j, sum
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void triangular_series ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) Console . Write ( i * ( i + 1 ) / 2 + " ▁ " ) ; } public static void Main ( ) { int n = 5 ; triangular_series ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void checksum ( int n ) { if ( n % 3 == 0 ) Console . WriteLine ( n / 3 - 1 + " ▁ " + n / 3 + " ▁ " + ( n / 3 + 1 ) ) ; else Console . WriteLine ( " - 1" ) ; } public static void Main ( ) { int n = 6 ; checksum ( n ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int divisorSum ( int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; ++ i ) sum += ( n / i ) * i ; return sum ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( divisorSum ( n ) ) ; n = 5 ; Console . WriteLine ( divisorSum ( n ) ) ; } }

Accumulator variables: sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static int sum_all_divisors ( int num ) { int sum = 0 ; for ( int i = 1 ; i <= Math . Sqrt ( num ) ; i ++ ) { sum += t1 + t2 ; } return sum ; } public static void Main ( String [ ] args ) { int n = 1 ; int sum = sum_all_divisors ( n ) ; Console . Write ( sum ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static double polite ( double n ) { n += 1 ; double base1 = 2 ; return n + ( Math . Log ( ( n + ( Math . Log ( n ) / Math . Log ( base1 ) ) ) ) ) / Math . Log ( base1 ) ; } public static void Main ( String [ ] args ) { double n = 7 ; Console . Write ( ( int ) polite ( n ) ) ; } }

Accumulator variables: n
Class/struct names: GFG
C# program:
using System ; public class GfG { public static int solve ( int low , int high , int T ) { while ( low <= high ) { int mid = ( low + high ) / 2 ; if ( ( mid * ( mid + 1 ) ) == T ) return mid ; if ( mid > 0 && ( mid * ( mid + 1 ) ) > T && ( mid * ( mid - 1 ) ) <= T ) return mid - 1 ; if ( ( mid * ( mid + 1 ) ) > T ) high = mid - 1 ; else low = mid + 1 ; } return - 1 ; } public static void Main ( ) { int T = 15 ; int ans = solve ( 1 , T , 2 * T ) ; if ( ans != - 1 ) ans -- ; Console . WriteLine ( " Number ▁ of ▁ stair ▁ steps ▁ = ▁ " + ans ) ; } }

Accumulator variables: ans
Class/struct names: GfG
C# program:
using System ; public class GfG { static bool isOverflow ( long a , long b ) { if ( a == 0 b == 0 ) return false ; long result = a * b ; if ( a == result / b ) return false ; else return true ; } public static void Main ( ) { long a = 10000000000 ; long b = - 10000000000 ; if ( isOverflow ( a , b ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Class/struct names: GfG
C# program:
using System ; class GFG { public static int oddSum ( int n ) { int sum = 0 , curr = 1 ; for ( int i = 0 ; i < n ; i ++ ) { sum += curr ; curr += 2 ; } return sum ; } public static void Main ( ) { int n = 20 ; Console . WriteLine ( " ▁ Sum ▁ of ▁ first ▁ " + n + " ▁ Odd ▁ Numbers ▁ is : ▁ " + oddSum ( n ) ) ; } }

Accumulator variables: curr, i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static int oddSum ( int n ) { return ( n * n ) ; } public static void Main ( ) { int n = 20 ; Console . WriteLine ( " ▁ Sum ▁ of ▁ first ▁ " + n + " ▁ Odd ▁ Numbers ▁ is : ▁ " + oddSum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void printKPFNums ( int A , int B , int K ) { bool [ ] prime = new bool [ B + 1 ] ; for ( int i = 0 ; i < B + 1 ; i ++ ) prime [ i ] = true ; int [ ] p_factors = new int [ B + 1 ] ; for ( int i = 0 ; i < B + 1 ; i ++ ) p_factors [ i ] = 0 ; for ( int p = 2 ; p <= B ; p ++ ) if ( p_factors [ p ] == 0 ) for ( int i = p ; i <= B ; i += p ) p_factors [ i ] ++ ; for ( int i = A ; i <= B ; i ++ ) if ( p_factors [ i ] == K ) Console . Write ( i + " ▁ " ) ; } public static void Main ( ) { int A = 14 , B = 18 , K = 2 ; printKPFNums ( A , B , K ) ; } }

Index/key variables: i, p
Accumulator variables: i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; public class GFG { static readonly int MAX = 100005 ; static void precompute ( int [ ] prefix , int [ ] suffix ) { bool [ ] prime = new bool [ MAX ] ; for ( int i = 0 ; i < MAX ; i ++ ) { prime [ i ] = true ; } for ( int i = 2 ; i * i < MAX ; i ++ ) { if ( prime [ i ] ) { for ( int j = i * i ; j < MAX ; j += i ) { prime [ j ] = false ; } } } prefix [ 1 ] = 1 ; suffix [ MAX - 1 ] = ( int ) 1e9 + 7 ; for ( int i = 2 ; i < MAX ; i ++ ) { if ( prime [ i ] ) { prefix [ i ] = i ; } else { prefix [ i ] = prefix [ i - 1 ] ; } } for ( int i = MAX - 2 ; i > 1 ; i -- ) { if ( prime [ i ] ) { suffix [ i ] = i ; } else { suffix [ i ] = suffix [ i + 1 ] ; } } } static int query ( int [ ] prefix , int [ ] suffix , int L , int R ) { if ( prefix [ R ] < L suffix [ L ] > R ) { return 0 ; } else { return prefix [ R ] - suffix [ L ] ; } } public static void Main ( ) { int q = 3 ; int [ ] L = { 2 , 2 , 24 } ; int [ ] R = { 5 , 2 , 28 } ; int [ ] prefix = new int [ MAX ] ; int [ ] suffix = new int [ MAX ] ; precompute ( prefix , suffix ) ; for ( int i = 0 ; i < q ; i ++ ) { Console . WriteLine ( query ( prefix , suffix , L [ i ] , R [ i ] ) ) ; } } }

Index/key variables: L, MAX, R, i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static float sum ( int x , int n ) { double i , total = 1.0 ; for ( i = 1 ; i <= n ; i ++ ) total = total + ( Math . Pow ( x , i ) / i ) ; return ( float ) total ; } public static void Main ( ) { int x = 2 ; int n = 5 ; Console . WriteLine ( sum ( x , n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isMember ( int a , int d , int x ) { if ( d == 0 ) return ( x == a ) ; return ( ( x - a ) % d == 0 && ( x - a ) / d >= 0 ) ; } public static void Main ( ) { int a = 1 , x = 7 , d = 3 ; if ( isMember ( a , d , x ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int binomialCoeff ( int n , int k ) { int [ ] C = new int [ k + 1 ] ; C [ 0 ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = Math . Min ( i , k ) ; j > 0 ; j -- ) C [ j ] = C [ j ] + C [ j - 1 ] ; } return C [ k ] ; } static long subsequences ( int [ ] a , int n , int r ) { Dictionary < int , int > left = new Dictionary < int , int > ( ) ; Dictionary < int , int > right = new Dictionary < int , int > ( ) ; long ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) if ( right . ContainsKey ( a [ i ] ) ) { right [ a [ i ] ] ++ ; } else { right . Add ( a [ i ] , 1 ) ; } if ( r == 1 ) { foreach ( KeyValuePair < int , int > i in right ) { ans += binomialCoeff ( i . Value , 3 ) ; } return ans ; } for ( int i = 0 ; i < n ; i ++ ) { long c1 = 0 , c2 = 0 ; if ( a [ i ] % r == 0 ) if ( left . ContainsKey ( a [ i ] / r ) ) c1 = left [ a [ i ] / r ] ; if ( right . ContainsKey ( a [ i ] ) ) { right [ a [ i ] ] -- ; } else { right . Add ( a [ i ] , - 1 ) ; } if ( right . ContainsKey ( a [ i ] * r ) ) c2 = right [ a [ i ] * r ] ; ans += c1 * c2 ; if ( left . ContainsKey ( a [ i ] ) ) { left [ a [ i ] ] ++ ; } else { left . Add ( a [ i ] , 1 ) ; } } return ans ; } public static void Main ( String [ ] args ) { int [ ] a = { 1 , 2 , 6 , 2 , 3 , 6 , 9 , 18 , 3 , 9 } ; int n = a . GetLength ( 0 ) ; int r = 3 ; Console . Write ( subsequences ( a , n , r ) ) ; } }

Index/key variables: i, j, k
Accumulator variables: ans, i, j
Iterator variables: i, j
Class/struct names: GFG