dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; public class GFG { static int countNumbers ( int n ) { int c = 0 ; int limit = ( int ) Math . Sqrt ( n ) ; int [ ] prime = new int [ limit + 1 ] ; for ( int i = 1 ; i <= limit ; i ++ ) { prime [ i ] = i ; } for ( int i = 2 ; i * i <= limit ; i ++ ) { if ( prime [ i ] == i ) { for ( int j = i * i ; j <= limit ; j += i ) { if ( prime [ j ] == j ) { prime [ j ] = i ; } } } } for ( int i = 2 ; i <= limit ; i ++ ) { int p = prime [ i ] ; int q = prime [ i / prime [ i ] ] ; if ( p * q == i && q != 1 && p != q ) { c += 1 ; } else if ( prime [ i ] == i ) { if ( Math . Pow ( i , 8 ) <= n ) { c += 1 ; } } } return c ; } public static void Main ( ) { int n = 1000 ; Console . WriteLine ( countNumbers ( n ) ) ; } }

Index/key variables: i, j
Accumulator variables: c, i, j
Iterator variables: i, j
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 isInterprime ( int n ) { if ( n < 4 ) return false ; int prev_prime = n ; int next_prime = n ; while ( ! isPrime ( prev_prime ) ) { prev_prime -- ; } while ( ! isPrime ( next_prime ) ) { next_prime ++ ; } if ( ( prev_prime + next_prime ) == 2 * n ) return true ; else return false ; } public static void Main ( ) { int n = 9 ; if ( isInterprime ( n ) ) Console . WriteLine ( " YES " ) ; else Console . WriteLine ( " NO " ) ; } }

Accumulator variables: next_prime, prev_prime
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int get_unit_digit ( int N ) { if ( N == 0 N == 1 ) return 1 ; else if ( N == 2 ) return 3 ; else if ( N == 3 ) return 9 ; return 3 ; } static public void Main ( ) { int N = 1 ; for ( N = 0 ; N <= 10 ; N ++ ) Console . WriteLine ( " For ▁ N ▁ = ▁ " + N + " ▁ : ▁ " + get_unit_digit ( N ) ) ; } }

Accumulator variables: N
Iterator variables: N
Class/struct names: GFG
C# program:
using System ; class gfg { int [ ] f = new int [ 1000 ] ; public int fib ( int n ) { if ( n == 0 ) return 0 ; if ( n == 1 n == 2 ) return ( f [ n ] = 1 ) ; if ( f [ n ] > 0 ) return f [ n ] ; int k = ( ( n & 1 ) > 0 ) ? ( n + 1 ) / 2 : n / 2 ; f [ n ] = ( ( n & 1 ) > 0 ) ? ( fib ( k ) * fib ( k ) + fib ( k - 1 ) * fib ( k - 1 ) ) : ( 2 * fib ( k - 1 ) + fib ( k ) ) * fib ( k ) ; return f [ n ] ; } public int calculateSumOfSquares ( int n ) { return fib ( n ) * fib ( n + 1 ) ; } } class geek { public static int Main ( ) { gfg g = new gfg ( ) ; int n = 6 ; Console . WriteLine ( " Sum ▁ of ▁ Squares ▁ of ▁ Fibonacci ▁ numbers ▁ is ▁ : ▁ { 0 } " , g . calculateSumOfSquares ( n ) ) ; return 0 ; } }

Index/key variables: n
Class/struct names: geek, gfg
C# program:
using System ; public class GFG { static int NumberOfSolutions ( int x , int y , int z , int n ) { int ans = 0 ; for ( int i = 0 ; i <= x ; i ++ ) { for ( int j = 0 ; j <= y ; j ++ ) { int temp = n - i - j ; if ( temp >= 0 ) { temp = Math . Min ( temp , z ) ; ans += temp + 1 ; } } } return ans ; } static public void Main ( ) { int x = 1 , y = 2 , z = 3 , n = 4 ; Console . WriteLine ( NumberOfSolutions ( x , y , z , n ) ) ; } }

Accumulator variables: ans, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int nthTerm ( int n ) { return ( int ) Math . Pow ( n , 2 ) + 4 * n ; } public static void Main ( ) { int N = 4 ; Console . WriteLine ( nthTerm ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool isPerfectSquare ( double x ) { double sr = Math . Sqrt ( x ) ; return ( ( sr - Math . Floor ( sr ) ) == 0 ) ; } static bool isProduct ( int num ) { int cnt = 0 ; for ( int i = 2 ; cnt < 2 && i * i <= num ; ++ i ) { while ( num % i == 0 ) { num /= i ; ++ cnt ; } } if ( num > 1 ) ++ cnt ; return cnt == 2 ; } static void findNumbers ( int N ) { List < int > vec = new List < int > ( ) ; for ( int i = 1 ; i <= N ; i ++ ) { if ( isProduct ( i ) && ! isPerfectSquare ( i ) ) { vec . Add ( i ) ; } } foreach ( var a in vec ) Console . Write ( a + " ▁ " ) ; } public static void Main ( String [ ] args ) { int N = 30 ; findNumbers ( N ) ; } }

Accumulator variables: i, num
Iterator variables: a, i
Class/struct names: GFG
C# program:
using System ; class solution { static int nthTerm ( int n ) { return 2 * ( int ) Math . Pow ( n , 3 ) + ( int ) Math . Pow ( n , 2 ) ; } public static void Main ( ) { int N = 3 ; Console . WriteLine ( nthTerm ( N ) ) ; } }

Class/struct names: solution
C# program:
using System ; class GFG { static long NthTerm ( long n ) { long x = ( 2 * n * n ) % 1000000009 ; return ( x - n + 1000000009 ) % 1000000009 ; } public static void Main ( ) { long N = 4 ; Console . WriteLine ( NthTerm ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int findSum ( int N ) { return ( N * ( N + 1 ) * ( 2 * N - 5 ) + 4 * N ) / 2 ; } static public void Main ( ) { int N = 3 ; Console . Write ( findSum ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int nthTerm ( int N ) { return ( ( 3 * N * N ) - ( 6 * N ) + 2 ) ; } public static void Main ( ) { int N = 3 ; Console . WriteLine ( nthTerm ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { private static int MAX = 16 ; static long [ , ] nCr = new long [ MAX , MAX ] ; static void binomial ( ) { for ( int i = 0 ; i < MAX ; i ++ ) { for ( int j = 0 ; j <= i ; j ++ ) { if ( j == 0 j == i ) nCr [ i , j ] = 1 ; else nCr [ i , j ] = nCr [ i - 1 , j ] + nCr [ i - 1 , j - 1 ] ; } } } static double findTanNTheta ( double tanTheta , int n ) { double ans = 0 , numerator = 0 , denominator = 0 ; long toggle = 1 ; for ( int i = 1 ; i <= n ; i += 2 ) { numerator = numerator + nCr [ n , i ] * Math . Pow ( tanTheta , i ) * toggle ; toggle = toggle * - 1 ; } denominator = 1 ; toggle = - 1 ; for ( int i = 2 ; i <= n ; i += 2 ) { numerator = numerator + nCr [ n , i ] * Math . Pow ( tanTheta , i ) * toggle ; toggle = toggle * - 1 ; } ans = numerator / denominator ; return ans ; } public static void Main ( ) { binomial ( ) ; double tanTheta = 0.3 ; int n = 10 ; Console . Write ( findTanNTheta ( tanTheta , n ) ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isDivisible ( long n ) { while ( n / 100 > 0 ) { long d = n % 10 ; n /= 10 ; n += d * 2 ; } return ( n % 19 == 0 ) ; } public static void Main ( ) { long n = 101156 ; if ( isDivisible ( n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: n
Class/struct names: GFG
C# program:
using System ; class GFG { static int calculateSum ( int n ) { return ( n * ( 4 * n * n + 6 * n - 1 ) / 3 ) ; } static public void Main ( ) { int n = 4 ; Console . WriteLine ( " Sum ▁ = ▁ " + calculateSum ( n ) ) ; } }

Class/struct names: GFG
C# program:
class GFG { static void printCombination ( int n ) { for ( int i = 1 ; i < n ; i ++ ) { if ( i % 3 != 0 ) { for ( int j = 1 ; j < n ; j ++ ) { if ( j % 3 != 0 ) { for ( int k = 1 ; k < n ; k ++ ) { if ( k % 3 != 0 && ( i + j + k ) == n ) { System . Console . WriteLine ( i + " ▁ " + j + " ▁ " + k ) ; return ; } } } } } } } static void Main ( ) { int n = 233 ; printCombination ( n ) ; } }

Accumulator variables: i, j, k
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
class GFG { static int percent ( int a , int b ) { float result = 0 ; result = ( ( b - a ) * 100 ) / a ; return ( int ) result ; } static void Main ( ) { int a = 20 , b = 25 ; System . Console . WriteLine ( percent ( a , b ) + " % " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int MAXN = 100005 ; static int [ ] spf = new int [ MAXN ] ; static int [ ] sum_digits = new int [ MAXN ] ; static bool [ ] isValid = new bool [ MAXN ] ; static int [ ] ans = new int [ MAXN ] ; static void Smallest_prime_factor ( ) { for ( int i = 1 ; 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 += 2 ) if ( spf [ i ] == i ) for ( int j = i * i ; j < MAXN ; j += i ) if ( spf [ j ] == j ) spf [ j ] = i ; } static int Digit_Sum ( int copy ) { int d = 0 ; while ( copy > 0 ) { d += copy % 10 ; copy /= 10 ; } return d ; } static void Sum_Of_All_Digits ( ) { for ( int n = 2 ; n < MAXN ; n ++ ) { sum_digits [ n ] = sum_digits [ n / spf [ n ] ] + Digit_Sum ( spf [ n ] ) ; if ( Digit_Sum ( n ) == sum_digits [ n ] ) isValid [ n ] = true ; } for ( int n = 2 ; n < MAXN ; n ++ ) { if ( isValid [ n ] ) ans [ n ] = 1 ; ans [ n ] += ans [ n - 1 ] ; } } public static void Main ( ) { Smallest_prime_factor ( ) ; Sum_Of_All_Digits ( ) ; int l , r ; l = 2 ; r = 3 ; Console . WriteLine ( " Valid ▁ numbers ▁ in ▁ the ▁ range ▁ " + l + " ▁ " + r + " ▁ are ▁ " + ( ans [ r ] - ans [ l - 1 ] ) ) ; l = 2 ; r = 10 ; Console . WriteLine ( " Valid ▁ numbers ▁ in ▁ the ▁ range ▁ " + l + " ▁ " + r + " ▁ are ▁ " + ( ans [ r ] - ans [ l - 1 ] ) ) ; } }

Index/key variables: MAXN, i, j, n, r
Accumulator variables: copy, d, i, j, n
Iterator variables: i, j, n
Class/struct names: GFG
C# program:
using System ; class GFG { public static int calculate ( int [ ] ar , int size ) { int count = 0 ; for ( int i = 0 ; i < size ; i ++ ) if ( ar [ i ] % 2 == 0 && ar [ i ] != 0 && ar [ i ] != 2 ) count ++ ; return count ; } static public void Main ( String [ ] args ) { int [ ] a = { 1 , 3 , 4 , 6 } ; int size = a . Length ; Console . WriteLine ( calculate ( a , size ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int N = 100001 ; static List < int > [ ] v = new List < int > [ N ] ; static void preprocess ( ) { for ( int i = 1 ; i < N ; i ++ ) { int num = i ; for ( int j = 2 ; j <= Math . Sqrt ( num ) ; j ++ ) { if ( num % j == 0 ) { v [ i ] . Add ( j ) ; while ( num % j == 0 ) { num = num / j ; } } } if ( num > 2 ) v [ i ] . Add ( num ) ; } } static int query ( int number , int n ) { return v [ number ] [ n - 1 ] ; } public static void Main ( String [ ] args ) { for ( int i = 0 ; i < N ; i ++ ) v [ i ] = new List < int > ( ) ; preprocess ( ) ; int number = 6 , n = 1 ; Console . Write ( query ( number , n ) + " STRNEWLINE " ) ; number = 210 ; n = 3 ; Console . Write ( query ( number , n ) + " STRNEWLINE " ) ; number = 210 ; n = 2 ; Console . Write ( query ( number , n ) + " STRNEWLINE " ) ; number = 60 ; n = 2 ; Console . Write ( query ( number , n ) + " STRNEWLINE " ) ; } }

Index/key variables: N, i, number
Accumulator variables: i, j
Iterator variables: i, j
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 ) ; } public static void Main ( ) { int a = 98 , b = 56 ; Console . WriteLine ( " GCD ▁ of ▁ " + a + " ▁ and ▁ " + b + " ▁ is ▁ " + gcd ( a , b ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static long dig ( long a ) { long count = 0 ; while ( a > 0 ) { a /= 10 ; count ++ ; } return count ; } static void required_number ( long num , long n , long d ) { long i , j , power = 1 , a , flag = 0 ; for ( i = num ; i >= 1 ; i -- ) { power = ( long ) Math . Pow ( 10 , i ) ; a = n % power ; if ( d > a ) { flag = 1 ; break ; } } if ( flag > 0 ) { long t = 0 ; for ( j = 0 ; j < i ; j ++ ) { t += ( long ) ( 9 * Math . Pow ( 10 , j ) ) ; } if ( n % power == t ) Console . Write ( n ) ; else { Console . Write ( n - ( n % power ) - 1 ) ; } } else Console . Write ( n ) ; } public static void Main ( ) { long n = 1029 , d = 102 ; long num = dig ( n ) ; required_number ( num , n , d ) ; } }

Accumulator variables: a, count, i, j, t
Iterator variables: i, j
Class/struct names: GFG
C# program:
class GFG { static int twoEggDrop ( int k ) { return ( int ) System . Math . Ceiling ( ( - 1.0 + System . Math . Sqrt ( 1 + 8 * k ) ) / 2.0 ) ; } public static void Main ( ) { int k = 100 ; System . Console . WriteLine ( twoEggDrop ( k ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static float findArea ( float a ) { float area ; area = ( float ) ( 5 * Math . Sqrt ( 3 ) * a * a ) ; return area ; } static float findVolume ( float a ) { float volume ; volume = ( float ) ( ( ( float ) 5 / 12 ) * ( 3 + Math . Sqrt ( 5 ) ) * a * a * a ) ; return volume ; } static public void Main ( ) { float a = 5 ; Console . WriteLine ( " Area : ▁ " + findArea ( a ) ) ; Console . WriteLine ( " Volume : ▁ " + findVolume ( a ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int ways ( int n ) { int first = 2 ; int second = 3 ; int res = 0 ; for ( int i = 3 ; i <= n ; i ++ ) { res = first + second ; first = second ; second = res ; } return res ; } static public void Main ( ) { int n = 7 ; Console . WriteLine ( " Total ▁ ways ▁ are : ▁ " + ways ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countDigits ( int n ) { double ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) ans += Math . Log10 ( i ) ; ans = ans * n ; return 1 + ( int ) Math . Floor ( ans ) ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( countDigits ( n ) + " STRNEWLINE " ) ; } }

Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static public void Main ( ) { double cm , meter , kilometer ; cm = 1000 ; meter = cm / 100.0 ; kilometer = cm / 100000.0 ; Console . WriteLine ( " Length ▁ in ▁ " + " meter ▁ = ▁ " + meter + " m " ) ; Console . WriteLine ( " Length ▁ in ▁ " + " Kilometer ▁ = ▁ " + kilometer + " km " ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static bool everMeet ( int x1 , int x2 , int v1 , int v2 ) { if ( x1 < x2 && v1 <= v2 ) { return false ; } if ( x1 > x2 && v1 >= v2 ) { return false ; } if ( x1 < x2 ) { swap ( x1 , x2 ) ; swap ( v1 , v2 ) ; } return ( ( x1 - x2 ) % ( v1 - v2 ) == 0 ) ; } static void swap ( int a , int b ) { int t = a ; a = b ; b = t ; } public static void Main ( ) { int x1 = 5 , v1 = 8 , x2 = 4 , v2 = 7 ; if ( everMeet ( x1 , x2 , v1 , v2 ) ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static void Main ( ) { int a = 4 ; int b = 3 ; int val = ( a + b - 1 ) / b ; Console . WriteLine ( " The ▁ ceiling " + " ▁ value ▁ of ▁ 4/3 ▁ is ▁ " + val ) ; a = 6 ; b = 3 ; val = ( a + b - 1 ) / b ; Console . WriteLine ( " The ▁ ceiling " + " ▁ value ▁ of ▁ 6/3 ▁ is ▁ " + val ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static double sumTillX ( double x , double n ) { double odd = Math . Ceiling ( n / 2.0 ) ; if ( x <= odd ) return x * x ; double even = x - odd ; return ( ( odd * odd ) + ( even * even ) + even ) ; } static double rangeSum ( double N , double L , double R ) { return sumTillX ( R , N ) - sumTillX ( L - 1 , N ) ; } public static void Main ( ) { long N = 10 , L = 1 , R = 6 ; Console . Write ( rangeSum ( N , L , R ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { public static void printtwinprime ( int n ) { bool [ ] prime = new bool [ n + 1 ] ; for ( int i = 0 ; i < n + 1 ; i ++ ) prime [ i ] = true ; for ( int p = 2 ; p * p <= n ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * 2 ; i <= n ; i += p ) prime [ i ] = false ; } } for ( int i = 2 ; i <= n - 2 ; i ++ ) { if ( prime [ i ] == true && prime [ i + 2 ] == true ) Console . Write ( " ▁ ( " + i + " , ▁ " + ( i + 2 ) + " ) " ) ; } } public static void Main ( ) { int n = 25 ; printtwinprime ( n ) ; } }

Index/key variables: i, p
Accumulator variables: i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isCubeFree ( int n ) { if ( n == 1 ) return false ; for ( int i = 2 ; i * i * i <= n ; i ++ ) if ( n % ( i * i * i ) == 0 ) return false ; return true ; } static void printCubeFree ( int n ) { for ( int i = 2 ; i <= n ; i ++ ) { if ( isCubeFree ( i ) ) { Console . Write ( i + " ▁ " ) ; } } } public static void Main ( ) { int n = 20 ; printCubeFree ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int inversegrayCode ( int n ) { int inv = 0 ; for ( ; n != 0 ; n = n >> 1 ) inv ^= n ; return inv ; } public static void Main ( ) { int n = 15 ; Console . Write ( inversegrayCode ( n ) ) ; } }

Accumulator variables: inv
Class/struct names: GFG
C# program:
using System ; public class GFG { public static long productPrimeFactors ( int n ) { long product = 1 ; if ( n % 2 == 0 ) { product *= 2 ; while ( n % 2 == 0 ) n = n / 2 ; } for ( int i = 3 ; i <= Math . Sqrt ( n ) ; i = i + 2 ) { if ( n % i == 0 ) { product = product * i ; while ( n % i == 0 ) n = n / i ; } } if ( n > 2 ) product = product * n ; return product ; } public static void Main ( String [ ] args ) { int n = 44 ; Console . Write ( productPrimeFactors ( n ) ) ; } }

Accumulator variables: product
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static double calculateProbability ( int N ) { double probability = ( double ) N / ( N + 1 ) ; return probability ; } public static void Main ( ) { int N ; double probabilityMax ; N = 1 ; probabilityMax = calculateProbability ( N ) ; Console . WriteLine ( " Maximum ▁ Probability ▁ for ▁ N ▁ = ▁ " + N + " ▁ is , ▁ " + Math . Round ( probabilityMax * 10000.0 ) / 10000.0 ) ; N = 2 ; probabilityMax = calculateProbability ( N ) ; Console . WriteLine ( " Maximum ▁ Probability ▁ for ▁ N ▁ = ▁ " + N + " ▁ is , ▁ " + Math . Round ( probabilityMax * 10000.0 ) / 10000.0 ) ; N = 10 ; probabilityMax = calculateProbability ( N ) ; Console . WriteLine ( " Maximum ▁ Probability ▁ for ▁ N ▁ = ▁ " + N + " ▁ is , ▁ " + Math . Round ( probabilityMax * 10000.0 ) / 10000.0 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float mean ( float [ ] mid , int [ ] freq , int n ) { float sum = 0 , freqSum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { sum = sum + mid [ i ] * freq [ i ] ; freqSum = freqSum + freq [ i ] ; } return sum / freqSum ; } static float groupedSD ( float [ ] lower_limit , float [ ] upper_limit , int [ ] freq , int n ) { float [ ] mid = new float [ n ] ; float sum = 0 , freqSum = 0 , sd ; for ( int i = 0 ; i < n ; i ++ ) { mid [ i ] = ( lower_limit [ i ] + upper_limit [ i ] ) / 2 ; sum = sum + freq [ i ] * mid [ i ] * mid [ i ] ; freqSum = freqSum + freq [ i ] ; } sd = ( float ) Math . Sqrt ( ( sum - freqSum * mean ( mid , freq , n ) * mean ( mid , freq , n ) ) / ( freqSum - 1 ) ) ; return sd ; } public static void Main ( ) { float [ ] lower_limit = { 50 , 61 , 71 , 86 , 96 } ; float [ ] upper_limit = { 60 , 70 , 85 , 95 , 100 } ; int [ ] freq = { 9 , 7 , 9 , 12 , 8 } ; int n = lower_limit . Length ; Console . WriteLine ( groupedSD ( lower_limit , upper_limit , freq , n ) ) ; } }

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

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

Class/struct names: GFG
C# program:
using System ; class GFG { static int squareSum ( int n ) { return n * ( 4 * n * n - 1 ) / 3 ; } public static void Main ( ) { Console . Write ( squareSum ( 8 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static bool isPrime ( int n ) { if ( n % 2 == 0 ) return false ; for ( int i = 3 ; i * i <= n ; i += 2 ) if ( n % i == 0 ) return false ; return true ; } public static int nextPrime ( int start ) { int next = start + 1 ; while ( ! isPrime ( next ) ) next ++ ; return next ; } public static bool areAdjacentPrimes ( int a , int b , int c ) { if ( ! isPrime ( a ) || ! isPrime ( b ) || ! isPrime ( c ) ) return false ; int next = nextPrime ( a ) ; if ( next != b ) return false ; if ( nextPrime ( b ) != c ) return false ; return true ; } public static void Main ( ) { if ( areAdjacentPrimes ( 11 , 13 , 19 ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: i, next
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int checkSemiprime ( int num ) { int cnt = 0 ; for ( int i = 2 ; cnt < 2 && i * i <= num ; ++ i ) while ( num % i == 0 ) { num /= i ; ++ cnt ; } if ( num > 1 ) ++ cnt ; return cnt == 2 ? 1 : 0 ; } static void semiprime ( int n ) { if ( checkSemiprime ( n ) != 0 ) Console . WriteLine ( " True " ) ; else Console . WriteLine ( " False " ) ; } public static void Main ( ) { int n = 6 ; semiprime ( n ) ; n = 8 ; semiprime ( n ) ; } }

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

Accumulator variables: i
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; public class GfG { static int sumOfSeries ( int n ) { return ( n * ( n + 1 ) * ( 2 * n + 1 ) ) / 6 ; } public static void Main ( ) { int n = 10 ; Console . WriteLine ( sumOfSeries ( n ) ) ; } }

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

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static int __gcd ( int a , int b ) { if ( b == 0 ) { return a ; } else { return __gcd ( b , a % b ) ; } } static int LCM ( int x , int y , int z ) { int ans = ( ( x * y ) / ( __gcd ( x , y ) ) ) ; return ( ( z * ans ) / ( __gcd ( ans , z ) ) ) ; } static int findDivisible ( int n , int x , int y , int z ) { int lcm = LCM ( x , y , z ) ; int ndigitnumber = ( int ) Math . Pow ( 10 , n - 1 ) ; int reminder = ndigitnumber % lcm ; if ( reminder == 0 ) return ndigitnumber ; ndigitnumber += lcm - reminder ; if ( ndigitnumber < Math . Pow ( 10 , n ) ) return ndigitnumber ; else return 0 ; } static public void Main ( ) { int n = 4 , x = 2 , y = 3 , z = 5 ; int res = findDivisible ( n , x , y , z ) ; if ( res != 0 ) Console . WriteLine ( res ) ; else Console . WriteLine ( " Not ▁ possible " ) ; } }

Accumulator variables: ndigitnumber
Class/struct names: GFG
C# program:
using System ; class GFG { public static int squaresum ( int n ) { return ( n * ( n + 1 ) / 2 ) * ( 2 * n + 1 ) / 3 ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( squaresum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double distance ( int x1 , int y1 , int x2 , int y2 ) { return Math . Sqrt ( Math . Pow ( x2 - x1 , 2 ) + Math . Pow ( y2 - y1 , 2 ) * 1.0 ) ; } public static void Main ( ) { Console . WriteLine ( Math . Round ( distance ( 3 , 4 , 4 , 3 ) * 100000.0 ) / 100000.0 ) ; } }

Class/struct names: GFG