dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static bool isPrime ( int n ) { if ( n == 0 n == 1 ) return false ; int root = ( int ) Math . Sqrt ( n ) ; for ( int i = 2 ; i <= root ; i ++ ) if ( n % i == 0 ) return false ; return true ; } static bool isSandwitched ( int n ) { return ( isPrime ( n - 1 ) && isPrime ( n + 1 ) ) ; } public static void Main ( ) { int n = 642 ; Console . Write ( n + " ▁ : ▁ " ) ; if ( isSandwitched ( n ) ) Console . WriteLine ( " Yes " ) ; else Console . Write ( " No " ) ; n = 9 ; Console . Write ( n + " ▁ : ▁ " ) ; if ( isSandwitched ( n ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static int day_of_the_week ( int y , int m , int d ) { int [ ] t = { 0 , 3 , 2 , 5 , 0 , 3 , 5 , 1 , 4 , 6 , 2 , 4 } ; if ( m < 3 ) y -= 1 ; return ( y + y / 4 - y / 100 + y / 400 + t [ m - 1 ] + d ) % 7 ; } public static void Main ( ) { int day = 13 , month = 7 , year = 2017 ; Console . WriteLine ( day_of_the_week ( year , month , day ) ) ; } }

Accumulator variables: y
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPrime ( int n , int i ) { if ( n <= 2 ) return ( n == 2 ) ? true : false ; if ( n % i == 0 ) return false ; if ( i * i > n ) return true ; return isPrime ( n , i + 1 ) ; } static void Main ( ) { int n = 15 ; if ( isPrime ( n , 2 ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isSquareFree ( int n ) { if ( n % 2 == 0 ) n = n / 2 ; if ( n % 2 == 0 ) return false ; for ( int i = 3 ; i <= Math . Sqrt ( n ) ; i = i + 2 ) { if ( n % i == 0 ) { n = n / i ; if ( n % i == 0 ) return false ; } } return true ; } public static void Main ( ) { int n = 10 ; if ( isSquareFree ( n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static double findArea ( double d ) { return ( d * d ) / 2 ; } public static void Main ( ) { double d = 10 ; Console . WriteLine ( findArea ( d ) ) ; } }

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

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

Class/struct names: GFG
C# program:
using System ; class GFG { static float mean ( float [ ] arr , int n ) { float sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum = sum + arr [ i ] ; return sum / n ; } static float SSD ( float [ ] arr , int n ) { float sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum = sum + ( arr [ i ] - mean ( arr , n ) ) * ( arr [ i ] - mean ( arr , n ) ) ; return ( float ) Math . Sqrt ( sum / ( n - 1 ) ) ; } static float sampleError ( float [ ] arr , int n ) { return SSD ( arr , n ) / ( float ) Math . Sqrt ( n ) ; } public static void Main ( ) { float [ ] arr = { 78.53f , 79.62f , 80.25f , 81.05f , 83.21f , 83.46f } ; int n = arr . Length ; Console . Write ( sampleError ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int StepstoReachTarget ( int target ) { target = Math . Abs ( target ) ; int n = ( int ) Math . Ceiling ( ( - 1.0 + ( int ) Math . Sqrt ( 1 + 8.0 * target ) ) / 2 ) ; int sum = n * ( n + 1 ) / 2 ; if ( sum == target ) return n ; int d = sum - target ; if ( ( d & 1 ) == 0 ) return n ; else return n + ( ( n & 1 ) != 0 ? 2 : 1 ) ; } public static void Main ( ) { int target = 5 ; Console . Write ( StepstoReachTarget ( target ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double seriesSum ( int n ) { int i = 1 ; double res = 0.0 ; bool sign = true ; while ( n > 0 ) { n -- ; if ( sign ) { sign = ! sign ; res = res + ( double ) ++ i / ++ i ; } else { sign = ! sign ; res = res - ( double ) ++ i / ++ i ; } } return res ; } public static void Main ( ) { int n = 5 ; Console . Write ( seriesSum ( n ) ) ; } }

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

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

Class/struct names: GFG
C# program:
using System ; class GFG { static float Mean ( float [ ] arr , int n ) { float sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum = sum + arr [ i ] ; return sum / n ; } static float meanAbsDevtion ( float [ ] arr , int n ) { float absSum = 0 ; for ( int i = 0 ; i < n ; i ++ ) absSum = absSum + Math . Abs ( arr [ i ] - Mean ( arr , n ) ) ; return absSum / n ; } public static void Main ( ) { float [ ] arr = { 10 , 15 , 15 , 17 , 18 , 21 } ; int n = arr . Length ; Console . WriteLine ( meanAbsDevtion ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class Ratio { static bool isRatioPossible ( int lowCost , int upCost , int lowQuant , int upQuant , int r ) { for ( int i = lowQuant ; i <= upQuant ; i ++ ) { int ans = i * r ; if ( lowCost <= ans && ans <= upCost ) return true ; } return false ; } public static void Main ( ) { int lowCost = 14 , upCost = 30 , lowQuant = 5 , upQuant = 12 , r = 9 ; if ( isRatioPossible ( lowCost , upCost , lowQuant , upQuant , r ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: Ratio
C# program:
using System ; class GFG { static void findNumbers ( int n , int d ) { for ( int i = 0 ; i < n - 2 ; i ++ ) Console . Write ( "1" + " ▁ " ) ; Console . Write ( "2" + " ▁ " ) ; Console . Write ( n + d ) ; } public static void Main ( ) { int N = 3 , D = 5 ; findNumbers ( N , D ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static long oddNumSum ( int n ) { return ( n * ( 2 * n + 1 ) * ( 24 * n * n * n - 12 * n * n - 14 * n + 7 ) ) / 15 ; } public static void Main ( ) { int n = 4 ; Console . Write ( oddNumSum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int trailingZero ( int x ) { int i = 5 , count = 0 ; while ( x > i ) { count = count + x / i ; i = i * 5 ; } return count ; } static int countProductTrailing ( int M , int N ) { return trailingZero ( N ) + trailingZero ( M ) ; } public static void Main ( ) { int N = 67 , M = 98 ; Console . WriteLine ( countProductTrailing ( N , M ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isTrimorphic ( int N ) { int cube = N * N * N ; while ( N > 0 ) { if ( N % 10 != cube % 10 ) return false ; N /= 10 ; cube /= 10 ; } return true ; } public static void Main ( ) { int N = 24 ; if ( isTrimorphic ( N ) == true ) Console . Write ( " trimorphic " ) ; else Console . Write ( " not ▁ trimorphic " ) ; } }

Accumulator variables: N, cube
Class/struct names: GFG
C# program:
using System ; class GFG { static int INT_MAX = 2147483647 ; static bool checkTrimorphic ( int num ) { int cube = num * num * num ; while ( num > 0 ) { if ( num % 10 != cube % 10 ) return false ; num /= 10 ; cube /= 10 ; } return true ; } static int nthTrimorphic ( int n ) { int count = 0 ; for ( int i = 0 ; i < INT_MAX ; i ++ ) { if ( checkTrimorphic ( i ) ) count ++ ; if ( count == n ) return i ; } return - 1 ; } static int Main ( ) { int n = 9 ; Console . Write ( nthTrimorphic ( n ) ) ; return 0 ; } }

Accumulator variables: count, cube, i, num
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int reachTarget ( int target ) { target = Math . Abs ( target ) ; int sum = 0 , step = 0 ; while ( sum < target || ( sum - target ) % 2 != 0 ) { step ++ ; sum += step ; } return step ; } public static void Main ( ) { int target = 5 ; Console . WriteLine ( reachTarget ( target ) ) ; } }

Accumulator variables: step, sum
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class palindrome_selfie { HashSet < int > all_permutes = new HashSet < int > ( ) ; public palindrome_selfie ( int num ) { number = num ; } public int palindrome ( int num ) { int reversednum = 0 ; int d ; while ( num > 0 ) { reversednum = reversednum * 10 + d ; } return reversednum ; } public void palin_selfie ( ) { int l = String . Join ( " " , number ) . Length - 1 ; all_permutes . Remove ( palindrome ( number ) ) ; all_permutes . Remove ( number ) ; foreach ( var number2 in all_permutes ) { if ( number * palindrome ( number ) == number2 * palindrome ( number2 ) ) { Console . WriteLine ( " Palindrome ▁ multiplicative " + " selfie ▁ of ▁ " + number + " ▁ is ▁ : ▁ " + number2 ) ; break ; } } if ( flag == false ) { Console . WriteLine ( " Given ▁ number ▁ has ▁ " + " no ▁ palindrome ▁ selfie . " ) ; } } public void permute ( int num , int l , int r ) { if ( l == r ) all_permutes . Add ( num ) ; else { for ( int i = l ; i <= r ; i ++ ) { num = swap ( num , l , i ) ; permute ( num , l + 1 , r ) ; } } } public int swap ( int num , int i , int j ) { char temp ; char [ ] charArray = String . Join ( " " , num ) . ToCharArray ( ) ; temp = charArray [ i ] ; charArray [ i ] = charArray [ j ] ; charArray [ j ] = temp ; return int . Parse ( String . Join ( " " , charArray ) ) ; } public static void Main ( String [ ] args ) { palindrome_selfie example1 = new palindrome_selfie ( 145572 ) ; example1 . palin_selfie ( ) ; palindrome_selfie example2 = new palindrome_selfie ( 19362 ) ; example2 . palin_selfie ( ) ; palindrome_selfie example3 = new palindrome_selfie ( 4669 ) ; example3 . palin_selfie ( ) ; } }

Index/key variables: i, j
Accumulator variables: i
Iterator variables: i, number2
Class/struct names: palindrome_selfie
C# program:
using System ; class GFG { static long fifthPowerSum ( int n ) { return ( ( 2 * n * n * n * n * n * n ) + ( 6 * n * n * n * n * n ) + ( 5 * n * n * n * n ) - ( n * n ) ) / 12 ; } public static void Main ( ) { int n = 5 ; Console . Write ( fifthPowerSum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int unitDigitXRaisedY ( int x , int y ) { int res = 1 ; for ( int i = 0 ; i < y ; i ++ ) res = ( res * x ) % 10 ; return res ; } public static void Main ( ) { Console . WriteLine ( unitDigitXRaisedY ( 4 , 2 ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { class pair { public float first , second ; public pair ( float first , float second ) { this . first = first ; this . second = second ; } } static List < pair > List ; static float sigma_fx ( pair [ ] a ) { float sum = 0 ; foreach ( pair i in a ) { sum += i . first * i . second ; } return sum ; } static float sigma_f ( pair [ ] a ) { float sum = 0.0f ; foreach ( pair i in a ) { sum += i . second ; } return sum ; } static float calculate_mean ( pair [ ] a ) { return sigma_fx ( a ) / sigma_f ( a ) ; } static float calculate_std ( pair [ ] a ) { float f = sigma_f ( a ) ; float mean = sigma_fx ( a ) / f ; float sum = 0 ; foreach ( pair i in a ) { sum += ( i . first - mean ) * ( i . first - mean ) * i . second ; } return ( float ) Math . Sqrt ( sum / f ) ; } public static void Main ( String [ ] args ) { pair [ ] A = { new pair ( 0f , 0.1f ) , new pair ( 100f , 0.1f ) , new pair ( 200f , 0.2f ) , new pair ( 333f , 0.3f ) , new pair ( 400f , 0.3f ) } ; pair [ ] B = { new pair ( 100f , 0.1f ) , new pair ( 200f , 0.5f ) , new pair ( 700f , 0.4f ) } ; float avg_A = calculate_mean ( A ) ; float avg_B = calculate_mean ( B ) ; float std_A = calculate_std ( A ) ; float std_B = calculate_std ( B ) ; Console . Write ( " For ▁ Investment ▁ A " + " STRNEWLINE " ) ; Console . Write ( " Average : ▁ " + avg_A + " STRNEWLINE " ) ; Console . Write ( " Standard ▁ Deviation : ▁ " + std_A + " STRNEWLINE " ) ; Console . Write ( " Normalised ▁ Std : ▁ " + std_A / avg_A + " STRNEWLINE " ) ; Console . Write ( " For ▁ Investment ▁ B " + " STRNEWLINE " ) ; Console . Write ( " Average : ▁ " + avg_B + " STRNEWLINE " ) ; Console . Write ( " Standard ▁ Deviation : ▁ " + std_B + " STRNEWLINE " ) ; Console . Write ( " Normalised ▁ Std : ▁ " + std_B / avg_B + " STRNEWLINE " ) ; if ( ( std_B / avg_B ) < ( std_A / avg_A ) ) Console . Write ( " Investment ▁ B ▁ is ▁ less ▁ risky STRNEWLINE " ) ; else Console . Write ( " Investment ▁ A ▁ is ▁ less ▁ risky STRNEWLINE " ) ; } }

Accumulator variables: sum
Iterator variables: i
Class/struct names: GFG, pair
C# program:
using System ; class GFG { static int findDivisor ( int x , int y ) { if ( x == y ) return y ; return 2 ; } public static void Main ( ) { int x = 3 , y = 16 ; Console . Write ( findDivisor ( x , y ) ) ; } }

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

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GfG { public static int sumofFactors ( int n ) { if ( n % 2 != 0 ) return 0 ; 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 ; if ( i == 2 && count == 1 ) curr_sum = 0 ; curr_term *= i ; curr_sum += curr_term ; } res *= curr_sum ; } if ( n >= 2 ) res *= ( 1 + n ) ; return res ; } public static void Main ( ) { int n = 18 ; Console . WriteLine ( sumofFactors ( n ) ) ; } }

Accumulator variables: count, curr_sum, curr_term, i, res
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; using System . Collections . Generic ; class GFG { class pair { public int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static int LCM ( int a , int b ) { return ( a * b ) / ( __gcd ( a , b ) ) ; } static int __gcd ( int a , int b ) { return b == 0 ? a : __gcd ( b , a % b ) ; } static int lcmOfNumerator ( List < pair > vect ) { int lcm = vect [ 0 ] . first ; for ( int i = 1 ; i < vect . Count ; i ++ ) lcm = LCM ( vect [ i ] . first , lcm ) ; return lcm ; } static int gcdOfDemoninators ( List < pair > vect ) { int gcd = vect [ 0 ] . second ; for ( int i = 1 ; i < vect . Count ; i ++ ) gcd = __gcd ( vect [ i ] . second , gcd ) ; return gcd ; } static void lcmOfRationals ( List < pair > vect ) { Console . Write ( lcmOfNumerator ( vect ) + " / " + gcdOfDemoninators ( vect ) ) ; } public static void Main ( String [ ] args ) { List < pair > vect = new List < pair > ( ) ; vect . Add ( new pair ( 2 , 7 ) ) ; vect . Add ( new pair ( 3 , 14 ) ) ; vect . Add ( new pair ( 5 , 3 ) ) ; lcmOfRationals ( vect ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG, pair
C# program:
using System ; class GfG { public static float focal_length_concave ( float R ) { return R / 2 ; } public static float focal_length_convex ( float R ) { return - ( R / 2 ) ; } public static void Main ( String [ ] argc ) { float R = 30 ; Console . Write ( " Focal ▁ length ▁ of " + " spherical ▁ concave " + " mirror ▁ is ▁ : ▁ " + focal_length_concave ( R ) + " ▁ units STRNEWLINE " ) ; Console . Write ( " Focal ▁ length ▁ of " + " spherical ▁ convex " + " mirror ▁ is ▁ : ▁ " + focal_length_convex ( R ) + " ▁ units " ) ; } }

Class/struct names: GfG
C# program:
using System ; class GFG { static int sumofoddFactors ( int n ) { int res = 1 ; while ( n % 2 == 0 ) n = n / 2 ; for ( int i = 3 ; 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 ; } public static void Main ( String [ ] argc ) { int n = 30 ; Console . Write ( sumofoddFactors ( n ) ) ; } }

Accumulator variables: count, curr_sum, curr_term, i, res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countSolutions ( int n , int val ) { int total = 0 ; if ( n == 1 && val >= 0 ) return 1 ; for ( int i = 0 ; i <= val ; i ++ ) { total += countSolutions ( n - 1 , val - i ) ; } return total ; } public static void Main ( ) { int n = 5 ; int val = 20 ; Console . WriteLine ( countSolutions ( n , val ) ) ; } }

Accumulator variables: i, total
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int N = 6 ; static void fib ( int [ ] f , int n ) { int i ; f [ 0 ] = 0 ; f [ 1 ] = 1 ; for ( i = 2 ; i <= n ; i ++ ) f [ i ] = f [ i - 1 ] + f [ i - 2 ] ; } static void fibcoef ( int [ , ] fc , int [ ] f , int n ) { for ( int i = 0 ; i <= n ; i ++ ) fc [ i , 0 ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j <= i ; j ++ ) { int k = j ; while ( k > 0 ) { k -- ; fc [ i , j ] *= f [ k ] ; } k = 1 ; while ( ( j + 1 ) != k ) fc [ i , j ] /= f [ k ++ ] ; } } } static void printFibonomialTriangle ( int n ) { int [ ] f = new int [ N + 1 ] ; fib ( f , n ) ; int [ , ] dp = new int [ N + 1 , N + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) dp [ i , 0 ] = dp [ i , i ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j < i ; j ++ ) dp [ i , j ] = f [ i - j + 1 ] * dp [ i - 1 , j - 1 ] + f [ j - 1 ] * dp [ i - 1 , j ] ; } for ( int i = 0 ; i <= n ; i ++ ) { for ( int j = 0 ; j <= i ; j ++ ) Console . Write ( dp [ i , j ] + " ▁ " ) ; Console . WriteLine ( ) ; } } public static void Main ( ) { int n = 6 ; printFibonomialTriangle ( n ) ; } }

Index/key variables: i, k
Accumulator variables: i, j, k
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int sumofNterm ( int a , int d , int b , int r , int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) sum += ( int ) ( ( a + ( i - 1 ) * d ) * ( b * Math . Pow ( r , i - 1 ) ) ) ; return sum ; } public static void Main ( ) { int a = 1 , d = 1 , b = 2 , r = 2 , n = 3 ; Console . Write ( sumofNterm ( a , d , b , r , n ) ) ; } }

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

Accumulator variables: i, j, k, 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 ++ ) sum = sum + i * ( i + 1 ) * ( i + 2 ) ; 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 ; class GFG { static double Series ( double x , int n ) { double sum = 1 , term = 1 , fct , j , y = 2 , m ; int i ; for ( i = 1 ; i < n ; i ++ ) { fct = 1 ; for ( j = 1 ; j <= y ; j ++ ) { fct = fct * j ; } term = term * ( - 1 ) ; m = Math . Pow ( x , y ) / fct ; m = m * term ; sum = sum + m ; y += 2 ; } return sum ; } public static void Main ( ) { double x = 9 ; int n = 10 ; Console . Write ( Series ( x , n ) * 10000.0 / 10000.0 ) ; } }

Accumulator variables: i, j, y
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static float Series ( double x , int n ) { double sum = 1 , term = 1 , fct = 1 ; double p = 1 , multi = 1 ; for ( int i = 1 ; i < n ; i ++ ) { fct = fct * multi * ( multi + 1 ) ; p = p * x * x ; term = ( - 1 ) * term ; multi += 2 ; sum = sum + ( term * p ) / fct ; } return ( float ) sum ; } public static void Main ( ) { double x = 9 ; int n = 10 ; Console . Write ( Series ( x , n ) ) ; } }

Accumulator variables: i, multi
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GfG { static int two_factor ( int n ) { int twocount = 0 ; while ( n % 2 == 0 ) { twocount ++ ; n = n / 2 ; } return twocount ; } static int five_factor ( int n ) { int fivecount = 0 ; while ( n % 5 == 0 ) { fivecount ++ ; n = n / 5 ; } return fivecount ; } static int find_con_zero ( int [ ] arr , int n ) { int twocount = 0 ; int fivecount = 0 ; for ( int i = 0 ; i < n ; i ++ ) { twocount += two_factor ( arr [ i ] ) ; fivecount += five_factor ( arr [ i ] ) ; } if ( twocount < fivecount ) return twocount ; else return fivecount ; } public static void Main ( ) { int [ ] arr = { 100 , 10 , 5 , 25 , 35 , 14 } ; int n = 6 ; Console . WriteLine ( find_con_zero ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: fivecount, i, twocount
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; public class GfG { public static int first ( int a , int b , int c ) { a %= b ; for ( int i = 1 ; i <= b ; i ++ ) { a = a * 10 ; if ( a / b == c ) return i ; a %= b ; } return - 1 ; } public static void Main ( ) { int a = 1 , b = 4 , c = 5 ; Console . WriteLine ( first ( a , b , c ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; class GFG { static void subsetDifference ( int n ) { int s = n * ( n + 1 ) / 2 ; if ( n % 4 == 0 ) { Console . WriteLine ( " First ▁ " + " subset ▁ sum ▁ = ▁ " + s / 2 ) ; Console . WriteLine ( " Second ▁ " + " subset ▁ sum ▁ = ▁ " + s / 2 ) ; Console . WriteLine ( " Difference " + " ▁ = ▁ " + 0 ) ; } else { if ( n % 4 == 1 n % 4 == 2 ) { Console . WriteLine ( " First ▁ " + " subset ▁ sum ▁ = ▁ " + s / 2 ) ; Console . WriteLine ( " Second ▁ " + " subset ▁ sum ▁ = ▁ " + ( ( s / 2 ) + 1 ) ) ; Console . WriteLine ( " Difference " + " ▁ = ▁ " + 1 ) ; } else { Console . WriteLine ( " First ▁ " + " subset ▁ sum ▁ = ▁ " + s / 2 ) ; Console . WriteLine ( " Second ▁ " + " subset ▁ sum ▁ = ▁ " + s / 2 ) ; Console . WriteLine ( " Difference " + " ▁ = ▁ " + 0 ) ; } } } public static void Main ( ) { int n = 6 ; subsetDifference ( n ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static void timeToMeet ( double s , double v ) { double V = 3 * v / 2 ; double time = s / V ; Console . WriteLine ( ( float ) time ) ; } static public void Main ( ) { double s = 25 , v = 56 ; timeToMeet ( s , v ) ; } }

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

Accumulator variables: i, j, k, sum
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void checksum ( int n ) { if ( n == 0 ) { Console . WriteLine ( " - 1 ▁ 0 ▁ 1" ) ; return ; } int inc ; if ( n > 0 ) inc = 1 ; else inc = - 1 ; for ( int i = 0 ; i <= n - 2 ; i += inc ) { if ( i + i + 1 + i + 2 == n ) { Console . WriteLine ( i + " ▁ " + ( i + 1 ) + " ▁ " + ( i + 2 ) ) ; return ; } } Console . WriteLine ( " - 1" ) ; } public static void Main ( ) { int n = 6 ; checksum ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG