dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class gfg { public static double calculateSum ( double n ) { return 2 * ( Math . Pow ( n , 6 ) + 15 * Math . Pow ( n , 4 ) + 15 * Math . Pow ( n , 2 ) + 1 ) ; } public static int Main ( ) { double n = 1.4142 ; Console . WriteLine ( Math . Ceiling ( calculateSum ( n ) ) ) ; return 0 ; } }

Class/struct names: gfg
C# program:
class GFG { static int Sum_upto_nth_Term ( int n ) { return ( 1 - ( int ) System . Math . Pow ( - 2 , n ) ) ; } public static void Main ( ) { int N = 5 ; System . Console . WriteLine ( Sum_upto_nth_Term ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int xorEqualsOrCount ( int N ) { int count = 0 ; int bit ; while ( N > 0 ) { bit = N % 2 ; if ( bit == 0 ) count ++ ; N = N / 2 ; } return ( int ) Math . Pow ( 2 , count ) ; } public static void Main ( ) { int N = 7 ; Console . WriteLine ( xorEqualsOrCount ( N ) ) ; } }

Accumulator variables: count
Class/struct names: GFG
C# program:
using System ; class SumOfSeries { static int fact ( int n ) { if ( n == 1 ) return 1 ; return n * fact ( n - 1 ) ; } static double sum ( int x , int n ) { double total = 1.0 ; for ( int i = 1 ; i <= n ; i ++ ) { total = total + ( Math . Pow ( x , i ) / fact ( i + 1 ) ) ; } return total ; } public static void Main ( ) { int x = 5 , n = 4 ; Console . WriteLine ( " Sum ▁ is : ▁ " + sum ( x , n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: SumOfSeries
C# program:
using System ; class GFG { static int sum_of_series ( int n ) { int result = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { if ( i % 2 == 0 ) result = result - ( int ) Math . Pow ( i , 2 ) ; else result = result + ( int ) Math . Pow ( i , 2 ) ; } return result ; } public static void Main ( ) { int n = 3 ; Console . WriteLine ( sum_of_series ( n ) ) ; n = 10 ; Console . WriteLine ( sum_of_series ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findSum ( int N ) { return ( 2 * N * ( N + 1 ) * ( 4 * N + 17 ) + 54 * N ) / 6 ; } static void Main ( ) { int N = 4 ; Console . Write ( findSum ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; 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 findCosNTheta ( double sinTheta , int n ) { double cosTheta = Math . Sqrt ( 1 - sinTheta * sinTheta ) ; double ans = 0 ; long toggle = 1 ; for ( int i = 1 ; i <= n ; i += 2 ) { ans = ans + nCr [ n , i ] * Math . Pow ( cosTheta , n - i ) * Math . Pow ( sinTheta , i ) * toggle ; toggle = toggle * - 1 ; } return ans ; } public static void Main ( ) { binomial ( ) ; double sinTheta = 0.5 ; int n = 10 ; Console . Write ( findCosNTheta ( sinTheta , n ) ) ; } }

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

Class/struct names: GFG
C# program:
using System ; public class GFG { static int MAX = 16 ; static int [ , ] nCr = new int [ 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 findCosnTheta ( double cosTheta , int n ) { double sinTheta = Math . Sqrt ( 1 - cosTheta * cosTheta ) ; double ans = 0 ; int toggle = 1 ; for ( int i = 0 ; i <= n ; i += 2 ) { ans = ans + nCr [ n , i ] * Math . Pow ( cosTheta , n - i ) * Math . Pow ( sinTheta , i ) * toggle ; toggle = toggle * - 1 ; } return ans ; } public static void Main ( ) { binomial ( ) ; double cosTheta = 0.5 ; int n = 10 ; Console . WriteLine ( findCosnTheta ( cosTheta , n ) ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class solution { static int calculateSum ( int n ) { return ( ( int ) Math . Pow ( 10 , n + 1 ) * ( 9 * n - 1 ) + 10 ) / ( int ) Math . Pow ( 9 , 3 ) - n * ( n + 1 ) / 18 ; } public static void Main ( ) { int n = 3 ; Console . WriteLine ( " Sum = ▁ " + calculateSum ( n ) ) ; } }

Class/struct names: solution
C# program:
using System ; class GFG { static int calculateSum ( int n ) { if ( n % 2 == 1 ) return ( n + 1 ) / 2 ; return - n / 2 ; } public static void Main ( ) { int n = 8 ; Console . WriteLine ( calculateSum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static bool isPower ( int a ) { if ( a == 1 ) { return true ; } for ( int i = 2 ; i * i <= a ; i ++ ) { double val = Math . Log ( a ) / Math . Log ( i ) ; if ( ( val - ( int ) val ) < 0.00000001 ) { return true ; } } return false ; } public static void Main ( string [ ] args ) { int n = 16 ; Console . WriteLine ( isPower ( n ) ? " Yes " : " No " ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static float rmsValue ( int [ ] arr , int n ) { int square = 0 ; float mean = 0 ; float root = 0 ; for ( int i = 0 ; i < n ; i ++ ) { square += ( int ) Math . Pow ( arr [ i ] , 2 ) ; } mean = ( square / ( float ) ( n ) ) ; root = ( float ) Math . Sqrt ( mean ) ; return root ; } public static void Main ( ) { int [ ] arr = { 10 , 4 , 6 , 8 } ; int n = arr . Length ; Console . Write ( rmsValue ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, square
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static double Mixture ( int X , int Y , int Z ) { double result1 = 0.0 , result = 0.0 ; result1 = ( ( X - Y ) / ( float ) X ) ; result = Math . Pow ( result1 , Z ) ; result = result * X ; return result ; } public static void Main ( ) { int X = 10 , Y = 2 , Z = 2 ; Console . WriteLine ( ( float ) Mixture ( X , Y , Z ) + " ▁ litres " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int power ( int x , int y , int p ) { int res = 1 ; x = x % p ; while ( y > 0 ) { if ( y != 0 ) res = ( res * x ) % p ; y = y >> 1 ; x = ( x * x ) % p ; } return res ; } static int check ( int n ) { int mod = ( int ) ( 1e9 + 7 ) ; n -- ; int ans = n * n ; if ( ans >= mod ) ans %= mod ; ans += n + 2 ; if ( ans >= mod ) ans %= mod ; ans = ( power ( 2 , n , mod ) % mod * ans % mod ) % mod ; ans = ( ans - 1 + mod ) % mod ; return ans ; } public static void Main ( String [ ] args ) { int n = 4 ; Console . WriteLine ( check ( n ) ) ; } }

Accumulator variables: ans, n
Class/struct names: GFG
C# program:
using System ; class GfG { public static int findLCM ( int a , int b ) { int lar = Math . Max ( a , b ) ; int small = Math . Min ( a , b ) ; for ( int i = lar ; ; i += lar ) { if ( i % small == 0 ) return i ; } } public static void Main ( ) { int a = 5 , b = 7 ; Console . WriteLine ( " LCM ▁ of ▁ " + a + " ▁ and ▁ " + b + " ▁ is ▁ " + findLCM ( a , b ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GfG
C# program:
class GFG { static void primes ( int n ) { int i = 2 ; int j = 0 ; int [ ] result = new int [ n ] ; int z = 0 ; while ( j < n ) { bool flag = true ; for ( int item = 2 ; item <= ( int ) ( i * 1 / 2 ) ; item ++ ) if ( i % item == 0 && i != item ) { flag = false ; break ; } if ( flag ) { result [ z ++ ] = i ; j += 1 ; } i += 1 ; } for ( i = 0 ; i < result . Length ; i ++ ) { for ( j = 0 ; j <= i ; j ++ ) System . Console . Write ( result [ j ] ) ; System . Console . Write ( " ▁ " ) ; } } static void smar_wln ( int n ) { primes ( n ) ; } static void Main ( ) { int n = 5 ; System . Console . WriteLine ( " First ▁ " + n + " ▁ terms ▁ of ▁ the ▁ Sequence ▁ are " ) ; smar_wln ( n ) ; } }

Index/key variables: j, n
Accumulator variables: i, item, j, z
Iterator variables: i, item, j
Boolean variables: flag
Class/struct names: GFG
C# program:
using System ; class GFG { static int Pentatope_number ( int n ) { return n * ( n + 1 ) * ( n + 2 ) * ( n + 3 ) / 24 ; } public static void Main ( ) { int n = 7 ; Console . WriteLine ( n + " th ▁ " + " Pentatope ▁ number ▁ : " + Pentatope_number ( n ) ) ; n = 12 ; Console . WriteLine ( n + " th ▁ " + " Pentatope ▁ number ▁ : " + Pentatope_number ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int centeredIcosahedralNum ( int n ) { return ( 2 * n + 1 ) * ( 5 * n * n + 5 * n + 3 ) / 3 ; } public static void Main ( ) { int n = 10 ; Console . WriteLine ( centeredIcosahedralNum ( n ) ) ; n = 12 ; Console . WriteLine ( centeredIcosahedralNum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int centered_square_num ( int n ) { return n * n + ( ( n - 1 ) * ( n - 1 ) ) ; } static public void Main ( ) { int n = 7 ; Console . WriteLine ( n + " th ▁ Centered " + " ▁ square ▁ number : ▁ " + centered_square_num ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int Dodecagonal_number ( int n ) { return 5 * n * n - 4 * n ; } static void Main ( ) { int n = 7 ; Console . WriteLine ( Dodecagonal_number ( n ) ) ; n = 12 ; Console . WriteLine ( Dodecagonal_number ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void SieveOfEratosthenes ( int n , bool [ ] prime , bool [ ] primesquare , int [ ] a ) { for ( int i = 2 ; i <= n ; i ++ ) prime [ i ] = true ; for ( int i = 0 ; i <= ( n * n ) ; i ++ ) primesquare [ i ] = false ; prime [ 1 ] = false ; for ( int p = 2 ; p * p <= n ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * 2 ; i <= n ; i += p ) prime [ i ] = false ; } } int j = 0 ; for ( int p = 2 ; p <= n ; p ++ ) { if ( prime [ p ] ) { a [ j ] = p ; primesquare [ p * p ] = true ; j ++ ; } } } static int countDivisors ( int n ) { if ( n == 1 ) return 1 ; bool [ ] prime = new bool [ n + 1 ] ; bool [ ] primesquare = new bool [ n * n + 1 ] ; SieveOfEratosthenes ( n , prime , primesquare , a ) ; int ans = 1 ; for ( int i = 0 ; ; i ++ ) { if ( a [ i ] * a [ i ] * a [ i ] > n ) break ; int cnt = 1 ; while ( n % a [ i ] == 0 ) { n = n / a [ i ] ; } ans = ans * cnt ; } if ( prime [ n ] ) ans = ans * 2 ; else if ( primesquare [ n ] ) ans = ans * 3 ; else if ( n != 1 ) ans = ans * 4 ; } static int sumofFactors ( int n ) { int res = 1 ; for ( int i = 2 ; i <= Math . Sqrt ( n ) ; i ++ ) { int count = 0 , curr_sum = 1 ; int curr_term = 1 ; while ( n % i == 0 ) { count ++ ; n = n / i ; curr_term *= i ; curr_sum += curr_term ; } res *= curr_sum ; } if ( n >= 2 ) res *= ( 1 + n ) ; return res ; } static bool checkArithmetic ( int n ) { int count = countDivisors ( n ) ; int sum = sumofFactors ( n ) ; return ( sum % count == 0 ) ; } public static void Main ( String [ ] args ) { int n = 6 ; if ( checkArithmetic ( n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i, j, n, p
Accumulator variables: count, curr_sum, curr_term, i, j, p, res
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { static int magicOfSequence ( int N ) { return ( N * ( N + 1 ) / 2 ) + 2 * N ; } public static void Main ( ) { int N = 6 ; Console . Write ( magicOfSequence ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; using System . Linq ; using System . Collections ; class GFG { static void nextPower ( int N , ref List < int > power ) { int carry = 0 ; for ( int i = 0 ; i < power . Count ; i ++ ) { int prod = ( power [ i ] * N ) + carry ; power [ i ] = prod % 10 ; carry = prod / 10 ; } while ( carry >= 1 ) { power . Add ( carry % 10 ) ; carry = carry / 10 ; } } static void printPowerNumber ( int X , int N ) { List < int > power = new List < int > ( ) ; power . Add ( 1 ) ; List < int > res = new List < int > ( ) ; for ( int i = 1 ; i <= X ; i ++ ) { nextPower ( N , ref power ) ; res . Add ( power . Last ( ) ) ; res . Add ( power . First ( ) ) ; } for ( int i = 0 ; i < res . Count ; i ++ ) Console . Write ( res [ i ] ) ; } public static void Main ( ) { int N = 19 , X = 4 ; printPowerNumber ( X , N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int firstDigit ( int n ) { int fact = 1 ; for ( int i = 2 ; i <= n ; i ++ ) { fact = fact * i ; while ( fact % 10 == 0 ) fact = fact / 10 ; } while ( fact >= 10 ) fact = fact / 10 ; return fact ; } public static void Main ( ) { int n = 5 ; Console . Write ( firstDigit ( n ) ) ; } }

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

Accumulator variables: i, res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static void printGMeans ( int A , int B , int N ) { float R = ( float ) Math . Pow ( ( float ) ( B / A ) , 1.0 / ( float ) ( N + 1 ) ) ; for ( int i = 1 ; i <= N ; i ++ ) Console . Write ( A * Math . Pow ( R , i ) + " ▁ " ) ; } public static void Main ( ) { int A = 3 , B = 81 , N = 2 ; printGMeans ( A , B , N ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static long digitSum ( long n ) { long digSum = 0 ; while ( n > 0 ) { digSum += n % 10 ; n /= 10 ; } return digSum ; } public static long countInteger ( long n , long s ) { if ( n < s ) return 0 ; for ( long i = s ; i <= Math . Min ( n , s + 163 ) ; i ++ ) if ( ( i - digitSum ( i ) ) > s ) return ( n - i + 1 ) ; return 0 ; } public static void Main ( ) { long n = 1000 , s = 100 ; Console . WriteLine ( countInteger ( n , s ) ) ; } }

Accumulator variables: digSum, i, n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int division ( int num1 , int num2 ) { if ( num1 == 0 ) return 0 ; if ( num2 == 0 ) return int . MaxValue ; bool negResult = false ; if ( num1 < 0 ) { num1 = - num1 ; if ( num2 < 0 ) num2 = - num2 ; else negResult = true ; } else if ( num2 < 0 ) { num2 = - num2 ; negResult = true ; } int quotient = 0 ; while ( num1 >= num2 ) { num1 = num1 - num2 ; quotient ++ ; } if ( negResult ) quotient = - quotient ; return quotient ; } public static void Main ( ) { int num1 = 13 , num2 = 2 ; Console . Write ( division ( num1 , num2 ) ) ; } }

Accumulator variables: quotient
Boolean variables: negResult
Class/struct names: GFG
C# program:
using System ; class GFG { static void Nonagonal ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) { Console . Write ( i * ( 7 * i - 5 ) / 2 ) ; Console . Write ( " ▁ " ) ; } } public static void Main ( ) { int n = 10 ; Nonagonal ( n ) ; } }

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

Class/struct names: GFG
C# program:
using System ; class GFG { static bool checkplusperfect ( int x ) { int temp = x ; int n = 0 ; while ( x != 0 ) { x /= 10 ; n ++ ; } x = temp ; int sum = 0 ; while ( x != 0 ) { sum += ( int ) Math . Pow ( x % 10 , n ) ; x /= 10 ; } return ( sum == temp ) ; } public static void Main ( ) { int x = 9474 ; if ( checkplusperfect ( x ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: n, sum, x
Class/struct names: GFG
C# program:
using System ; class GFG { static int subsetCount ( int [ ] arr , int n ) { return 1 << n ; } public static void Main ( ) { int [ ] A = { 1 , 2 , 3 } ; int n = A . Length ; Console . WriteLine ( subsetCount ( A , n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float Calculate_GST ( float org_cost , float N_price ) { return ( ( ( N_price - org_cost ) * 100 ) / org_cost ) ; } public static void Main ( ) { float org_cost = 100 ; float N_price = 120 ; Console . Write ( " ▁ GST ▁ = ▁ " + Calculate_GST ( org_cost , N_price ) + " % " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int centeredHexagonalNumber ( int n ) { return 3 * n * ( n - 1 ) + 1 ; } public static void Main ( ) { int n = 10 ; Console . Write ( n + " th ▁ centered ▁ " + " hexagonal ▁ number : ▁ " ) ; Console . Write ( centeredHexagonalNumber ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static int find_distance ( int n ) { return n * ( ( 3 * n ) + 7 ) ; } public static void Main ( ) { int n = 5 ; Console . Write ( find_distance ( n ) ) ; } }

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 twinPrime ( int n1 , int n2 ) { return ( isPrime ( n1 ) && isPrime ( n2 ) && Math . Abs ( n1 - n2 ) == 2 ) ; } public static void Main ( ) { int n1 = 11 , n2 = 13 ; if ( twinPrime ( n1 , n2 ) ) Console . WriteLine ( " Twin ▁ Prime " ) ; else Console . WriteLine ( " Not ▁ Twin ▁ Prime " ) ; } }

Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static double sumOfSeries ( int n ) { return 0.0246 * ( Math . Pow ( 10 , n ) - 1 - ( 9 * n ) ) ; } public static void Main ( ) { int n = 3 ; Console . Write ( sumOfSeries ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int evenbinomialCoeffSum ( int n ) { return ( 1 << ( n - 1 ) ) ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( evenbinomialCoeffSum ( n ) ) ; } }

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

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

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 ++ ) for ( int j = 1 ; j <= i ; j ++ ) sum += j ; return sum ; } public static void Main ( ) { int n = 10 ; Console . Write ( sumOfSeries ( n ) ) ; } }

Accumulator variables: i, j, sum
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class Triangle { public static double numberOfTriangles ( int n ) { double ans = 2 * ( Math . Pow ( 3 , n ) ) - 1 ; return ans ; } public static void Main ( ) { int n = 2 ; Console . WriteLine ( numberOfTriangles ( n ) ) ; } }

Class/struct names: Triangle
C# program:
using System ; class GFG { public static int motzkin ( int n ) { int [ ] dp = new int [ n + 1 ] ; dp [ 0 ] = dp [ 1 ] = 1 ; for ( int i = 2 ; i <= n ; i ++ ) dp [ i ] = ( ( 2 * i + 1 ) * dp [ i - 1 ] + ( 3 * i - 3 ) * dp [ i - 2 ] ) / ( i + 2 ) ; return dp [ n ] ; } public static void Main ( ) { int n = 8 ; Console . WriteLine ( motzkin ( n ) ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static int kthgroupsum ( int k ) { return k * k * k ; } public static void Main ( ) { int k = 3 ; Console . WriteLine ( kthgroupsum ( k ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void printXYZ ( int n ) { if ( n == 1 ) Console . WriteLine ( - 1 ) ; else { Console . WriteLine ( " x ▁ is ▁ " + n ) ; Console . WriteLine ( " y ▁ is ▁ " + ( n + 1 ) ) ; Console . WriteLine ( " z ▁ is ▁ " + ( n * ( n + 1 ) ) ) ; } } public static void Main ( ) { int n = 7 ; printXYZ ( n ) ; } }

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

Class/struct names: GFG
C# program:
using System ; class GeeksforGeeks { static double compute ( int a , int b ) { double AM , GM , HM ; AM = ( a + b ) / 2 ; GM = Math . Sqrt ( a * b ) ; HM = ( GM * GM ) / AM ; return HM ; } public static void Main ( ) { int a = 5 , b = 15 ; double HM = compute ( a , b ) ; Console . WriteLine ( " Harmonic ▁ Mean ▁ between ▁ " + a + " ▁ and ▁ " + b + " ▁ is ▁ " + HM ) ; } }

Class/struct names: GeeksforGeeks
C# program:
using System ; class GFG { static int series ( int n ) { return ( 8 * n * n ) + 1 ; } public static void Main ( ) { int n = 5 ; Console . WriteLine ( series ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static int gcd ( int a , int b ) { return b == 0 ? a : gcd ( b , a % b ) ; } static bool isDivisible ( int x , int y ) { if ( y == 1 ) return true ; int z = gcd ( x , y ) ; if ( z == 1 ) return false ; return isDivisible ( x , y / z ) ; } public static void Main ( ) { int x = 18 , y = 12 ; if ( isDivisible ( x , y ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static void Main ( ) { double n = 5 , a = 2 ; Console . WriteLine ( sumOfSeries ( a , n ) ) ; } static float sumOfSeries ( double a , double n ) { double res = 0 , prev = 1 ; for ( int i = 1 ; i <= n ; i ++ ) { prev *= ( a / i ) ; res = res + prev ; } return ( float ) ( res ) ; } }

Accumulator variables: i, prev
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static float Cel_To_Fah ( float n ) { return ( ( n * 9.0f / 5.0f ) + 32.0f ) ; } public static void Main ( ) { float n = 20.0f ; Console . Write ( Cel_To_Fah ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void print_sequence ( int n , int k ) { int b = n / ( k * ( k + 1 ) / 2 ) ; if ( b == 0 ) { Console . Write ( " - 1" ) ; } else { int r = 1 ; for ( int x = 1 ; x * x <= n ; x ++ ) { if ( n % x != 0 ) continue ; if ( x <= b && x > r ) r = x ; if ( n / x <= b && n / x > r ) r = n / x ; } for ( int i = 1 ; i < k ; i ++ ) Console . Write ( r * i + " ▁ " ) ; int res = n - ( r * ( k * ( k - 1 ) / 2 ) ) ; Console . WriteLine ( res ) ; } } public static void Main ( ) { int n = 24 ; int k = 4 ; print_sequence ( n , k ) ; n = 24 ; k = 5 ; print_sequence ( n , k ) ; n = 6 ; k = 4 ; print_sequence ( n , k ) ; } }

Accumulator variables: i, x
Iterator variables: i, x
Class/struct names: GFG
C# program:
using System ; class GFG { public static int countCompositions ( int n ) { return 1 << ( n - 1 ) ; } public static void Main ( ) { int n = 4 ; Console . Write ( countCompositions ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int countDigit ( long n ) { if ( n / 10 == 0 ) return 1 ; return 1 + countDigit ( n / 10 ) ; } public static void Main ( ) { long n = 345289467 ; Console . WriteLine ( " Number ▁ of ▁ " + " digits ▁ : ▁ " + countDigit ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void printTrib ( int n ) { int [ ] dp = new int [ n ] ; dp [ 0 ] = dp [ 1 ] = 0 ; dp [ 2 ] = 1 ; for ( int i = 3 ; i < n ; i ++ ) dp [ i ] = dp [ i - 1 ] + dp [ i - 2 ] + dp [ i - 3 ] ; for ( int i = 0 ; i < n ; i ++ ) Console . Write ( dp [ i ] + " ▁ " ) ; } public static void Main ( ) { int n = 10 ; printTrib ( n ) ; } }

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