dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static int addNDigits ( int a , int b , int n ) { int num = a ; for ( int i = 0 ; i <= 9 ; i ++ ) { int tmp = a * 10 + i ; if ( tmp % b == 0 ) { a = tmp ; break ; } } if ( num == a ) return - 1 ; for ( int j = 0 ; j < n - 1 ; j ++ ) a *= 10 ; return a ; } public static void Main ( ) { int a = 5 , b = 3 , n = 3 ; Console . WriteLine ( addNDigits ( a , b , n ) ) ; } }

Accumulator variables: a, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int Triplets ( int n ) { int ans = 0 ; for ( int i = 1 ; i <= n ; ++ i ) { for ( int j = i ; j <= n ; ++ j ) { int x = i * i + j * j ; int y = ( int ) Math . Sqrt ( x ) ; if ( y * y == x && y <= n ) ++ ans ; } } return ans ; } static void Main ( ) { int n = 10 ; Console . WriteLine ( Triplets ( n ) ) ; } }

Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int solve ( int n , int base1 ) { int sum = 0 ; while ( n > 0 ) { int remainder1 = n % base1 ; sum += remainder1 ; n = n / base1 ; } return sum ; } static void SumsOfDigits ( int n ) { int sum = 0 ; for ( int base1 = 2 ; base1 <= n / 2 ; ++ base1 ) sum += solve ( n , base1 ) ; Console . WriteLine ( sum ) ; } public static void Main ( String [ ] args ) { int n = 8 ; SumsOfDigits ( n ) ; } }

Accumulator variables: sum
Iterator variables: base1
Class/struct names: GFG
C# program:
using System ; public class GFG { static bool checkPerfectcube ( int n ) { int d = ( int ) Math . Ceiling ( Math . Pow ( n , ( double ) 1 / 3 ) ) ; if ( d * d * d == n ) return true ; return false ; } static int largestNonPerfectcubeNumber ( int [ ] a , int n ) { int maxi = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( checkPerfectcube ( a [ i ] ) == false ) maxi = Math . Max ( a [ i ] , maxi ) ; } return maxi ; } public static void Main ( ) { int [ ] a = { 16 , 64 , 25 , 2 , 3 , 10 } ; int n = a . Length ; Console . WriteLine ( largestNonPerfectcubeNumber ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void checkIfPossibleRec ( int x , int a , int b , bool [ ] isPossible , int n ) { if ( x > n ) return ; if ( isPossible [ x ] ) return ; isPossible [ x ] = true ; checkIfPossibleRec ( x + a , a , b , isPossible , n ) ; checkIfPossibleRec ( x + b , a , b , isPossible , n ) ; } static bool checkPossible ( int n , int a , int b ) { bool [ ] isPossible = new bool [ n + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) isPossible [ i ] = false ; checkIfPossibleRec ( 0 , a , b , isPossible , n ) ; return isPossible [ n ] ; } static public void Main ( ) { int a = 3 , b = 7 , n = 8 ; if ( checkPossible ( a , b , n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i, n, x
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int sumOdd ( int n ) { int terms = ( n + 1 ) / 2 ; int sum = terms * terms ; return sum ; } static int suminRange ( int l , int r ) { return sumOdd ( r ) - sumOdd ( l - 1 ) ; } public static void Main ( ) { int l = 2 , r = 5 ; Console . WriteLine ( " Sum ▁ of ▁ odd ▁ natural ▁ numbers ▁ " + " from ▁ L ▁ to ▁ R ▁ is ▁ " + suminRange ( l , r ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int gcd ( int a , int b ) { if ( a == 0 ) return b ; return gcd ( b % a , a ) ; } static int sumcommDiv ( int a , int b ) { int n = gcd ( a , b ) ; int sum = 0 ; for ( int i = 1 ; i <= Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { if ( n / i == i ) sum += i ; else sum += ( n / i ) + i ; } } return sum ; } static public void Main ( ) { int a = 10 , b = 15 ; Console . WriteLine ( " Sum ▁ = ▁ " + sumcommDiv ( a , b ) ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static String checkNumber ( int N ) { int temp = N ; while ( temp > 0 ) { if ( temp % 1000 == 144 ) temp /= 1000 ; else if ( temp % 100 == 14 ) temp /= 100 ; else if ( temp % 10 == 1 ) temp /= 10 ; else { return " NO " ; } } return " YES " ; } public static void Main ( ) { int N = 1414 ; Console . WriteLine ( checkNumber ( N ) ) ; } }

Accumulator variables: temp
Class/struct names: GFG
C# program:
using System ; class GFG { static int getResult ( int n ) { if ( ( n & 1 ) > 0 ) return 1 ; return - 1 ; } public static void Main ( ) { int n = 3 ; Console . WriteLine ( getResult ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void findAandB ( double N ) { double val = N * N - 4.0 * N ; if ( val < 0 ) { Console . WriteLine ( " NO " ) ; return ; } double a = ( N + Math . Sqrt ( val ) ) / 2.0 ; double b = ( N - Math . Sqrt ( val ) ) / 2.0 ; Console . WriteLine ( " a ▁ = ▁ " + a ) ; Console . WriteLine ( " b ▁ = ▁ " + b ) ; } static void Main ( ) { double N = 69.0 ; findAandB ( N ) ; } }

Class/struct names: GFG
C# program:
class GFG { static int minOperations ( int [ ] A , int n ) { if ( ( n & 1 ) > 0 ) return - 1 ; int zeros = 0 , consZeros = 0 , ones = 0 ; for ( int i = 0 ; i < n ; ++ i ) { if ( A [ i ] == 0 ) zeros ++ ; else ones ++ ; if ( i + 1 < n ) { if ( A [ i ] == 0 && A [ i + 1 ] == 0 ) consZeros ++ ; } } if ( A [ 0 ] == A [ n - 1 ] && A [ 0 ] == 0 ) consZeros ++ ; if ( zeros == ones ) return consZeros ; else return - 1 ; } static void Main ( ) { int [ ] A = new int [ ] { 1 , 1 , 0 , 0 } ; int n = A . Length ; System . Console . WriteLine ( minOperations ( A , n ) ) ; } }

Index/key variables: i
Accumulator variables: consZeros, ones, zeros
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countdig ( int m ) { if ( m == 0 ) return 0 ; else return 1 + countdig ( m / 10 ) ; } static int countSteps ( int x ) { int c = 0 ; int last = x ; while ( last > 0 ) { int digits = countdig ( last ) ; digits -= 1 ; int divisor = ( int ) Math . Pow ( 10 , digits ) ; int first = last / divisor ; int lastnumber = first * divisor ; int skipped = ( last - lastnumber ) / first ; skipped += 1 ; c += skipped ; last = last - ( first * skipped ) ; } return c ; } static void Main ( ) { int n = 14 ; Console . WriteLine ( countSteps ( n ) ) ; } }

Accumulator variables: c, digits, skipped
Class/struct names: GFG
C# program:
using System ; class GFG { static long power ( long x , long y , long p ) { while ( y > 0 ) { if ( ( y & 1 ) != 0 ) res = ( res * x ) % p ; x = ( x * x ) % p ; } return res ; } static long gcd ( long a , long b ) { if ( a == 0 ) return b ; return gcd ( b % a , a ) ; } static long powerGCD ( long a , long b , long n ) { long e = power ( a , n , b ) ; return gcd ( e , b ) ; } public static void Main ( ) { long a = 5 , b = 4 , n = 2 ; Console . Write ( powerGCD ( a , b , n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool allOddDigits ( int n ) { while ( n != 0 ) { if ( ( n % 10 ) % 2 == 0 ) return false ; n /= 10 ; } return true ; } static int largestNumber ( int n ) { if ( n % 2 == 0 ) n -- ; for ( int i = n ; ; i -= 2 ) if ( allOddDigits ( i ) ) return i ; } public static void Main ( ) { int N = 23 ; Console . WriteLine ( largestNumber ( N ) ) ; } }

Accumulator variables: i, n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int largestNumber ( int n ) { string s = " " ; int duplicate = n ; while ( n > 0 ) { s = ( char ) ( n % 10 + 48 ) + s ; n /= 10 ; } int index = - 1 ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( ( ( int ) ( s [ i ] - '0' ) % 2 & 1 ) == 0 ) { index = i ; break ; } } if ( index == - 1 ) return duplicate ; int num = 0 ; for ( int i = 0 ; i < index ; i ++ ) num = num * 10 + ( int ) ( s [ i ] - '0' ) ; num = num * 10 + ( ( int ) s [ index ] - ( int ) ( '0' ) - 1 ) ; for ( int i = index + 1 ; i < s . Length ; i ++ ) num = num * 10 + 9 ; return num ; } static void Main ( ) { int N = 24578 ; Console . WriteLine ( largestNumber ( N ) ) ; } }

Index/key variables: i, index
Accumulator variables: i, n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countNumbers ( int N ) { return ( int ) ( Math . Sqrt ( N ) ) - 1 ; } public static void Main ( ) { int N = 36 ; Console . Write ( countNumbers ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int countOrderedPairs ( int N ) { int count_pairs = 0 ; for ( int i = 1 ; i <= ( int ) Math . Sqrt ( N - 1 ) ; ++ i ) { for ( int j = i ; j * i < N ; ++ j ) ++ count_pairs ; } count_pairs *= 2 ; count_pairs -= ( int ) ( Math . Sqrt ( N - 1 ) ) ; return count_pairs ; } static public void Main ( ) { int N = 5 ; Console . WriteLine ( countOrderedPairs ( N ) ) ; } }

Accumulator variables: count_pairs
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void pairwiseDifference ( int [ ] arr , int n ) { int diff ; for ( int i = 0 ; i < n - 1 ; i ++ ) { diff = Math . Abs ( arr [ i ] - arr [ i + 1 ] ) ; Console . WriteLine ( diff + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int [ ] arr = { 4 , 10 , 15 , 5 , 6 } ; int n = arr . Length ; pairwiseDifference ( arr , n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static long sumAP ( long n , long d ) { n /= d ; return ( n ) * ( 1 + n ) * d / 2 ; } static long sumMultiples ( long n ) { n -- ; return sumAP ( n , 2 ) + sumAP ( n , 5 ) - sumAP ( n , 10 ) ; } static public void Main ( ) { long n = 20 ; Console . WriteLine ( sumMultiples ( n ) ) ; } }

Accumulator variables: n
Class/struct names: GFG
C# program:
using System ; class GFG { static int markingScheme ( int N , int [ ] answerKey , int [ ] studentAnswer ) { int positive = 0 , negative = 0 , notattempt = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( studentAnswer [ i ] == 0 ) notattempt ++ ; else if ( answerKey [ i ] == studentAnswer [ i ] ) positive ++ ; else if ( answerKey [ i ] != studentAnswer [ i ] ) negative ++ ; } return ( positive * 3 ) + ( negative * - 1 ) ; } static public void Main ( ) { int [ ] answerKey = { 1 , 2 , 3 , 4 , 1 } ; int [ ] studentAnswer = { 1 , 2 , 3 , 4 , 0 } ; int N = answerKey . Length ; int marking_Scheme = markingScheme ( N , answerKey , studentAnswer ) ; Console . WriteLine ( marking_Scheme ) ; } }

Index/key variables: i
Accumulator variables: i, negative, notattempt, positive
Iterator variables: i
Class/struct names: GFG
C# program:
class GFG { static int MAX = 10000 ; static bool [ ] prime = new bool [ MAX + 1 ] ; static void SieveOfEratosthenes ( ) { prime [ 1 ] = true ; for ( int p = 2 ; p * p <= MAX ; p ++ ) { if ( prime [ p ] == false ) { for ( int i = p * 2 ; i <= MAX ; i += p ) prime [ i ] = true ; } } } static int solve ( int n ) { int count = 0 , num = 1 ; int prod = 1 ; while ( count < n ) { if ( ! prime [ num ] ) { prod *= num ; count ++ ; } num ++ ; } return prod ; } public static void Main ( ) { SieveOfEratosthenes ( ) ; int n = 5 ; System . Console . WriteLine ( solve ( n ) ) ; } }

Index/key variables: i, num, p
Accumulator variables: count, i, num, p, prod
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int divisor ( int a ) { int div = 1 , count = 0 ; for ( int i = 2 ; i <= Math . Sqrt ( a ) ; i ++ ) { while ( a % i == 0 ) { count ++ ; a = a / i ; } div = div * ( count + 1 ) ; count = 0 ; } if ( a > 1 ) { div = div * ( 2 ) ; } return div ; } static int OddDivCount ( int a , int b ) { int res = 0 ; for ( int i = a ; i <= b ; ++ i ) { int divCount = divisor ( i ) ; if ( divCount % 2 == 1 ) { ++ res ; } } return res ; } public static void Main ( String [ ] args ) { int a = 1 , b = 10 ; Console . WriteLine ( OddDivCount ( a , b ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static bool Check_is_possible ( int l , int r , int k ) { int div_count = ( r / k ) - ( l / k ) ; if ( l % k == 0 ) { div_count ++ ; } return ( div_count > 1 ) ; } public static void Main ( ) { int l = 30 , r = 70 , k = 10 ; if ( Check_is_possible ( l , r , k ) ) { Console . WriteLine ( " YES " ) ; } else { Console . WriteLine ( " NO " ) ; } } }

Accumulator variables: div_count
Class/struct names: GFG
C# program:
using System ; class gfg { public static double nth_group ( int n ) { return n * ( 2 * Math . Pow ( n , 2 ) + 1 ) ; } public static int Main ( ) { int N = 5 ; Console . WriteLine ( nth_group ( N ) ) ; return 0 ; } }

Class/struct names: gfg
C# program:
using System ; class GFG { static void printPossible ( int a , int b , int c ) { if ( ( a + b + c ) % 2 != 0 a + b < c ) Console . Write ( " NO " ) ; else Console . Write ( " YES " ) ; } public static void Main ( ) { int a = 2 , b = 4 , c = 2 ; printPossible ( a , b , c ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool isPerfectPower ( int n ) { if ( n == 1 ) { return true ; } for ( int x = 2 ; x <= Math . Sqrt ( n ) ; x ++ ) { int y = 2 ; int p = ( int ) Math . Pow ( x , y ) ; while ( p <= n && p > 0 ) { if ( p == n ) { return true ; } y ++ ; p = ( int ) Math . Pow ( x , y ) ; } } return false ; } static bool isStrongNumber ( int n ) { Dictionary < int , int > count = new Dictionary < int , int > ( ) ; while ( n % 2 == 0 ) { n = n / 2 ; if ( count . ContainsKey ( 2 ) ) { count [ 2 ] = count [ 2 ] + 1 ; } else { count . Add ( 2 , 1 ) ; } } for ( int i = 3 ; i <= Math . Sqrt ( n ) ; i += 2 ) { while ( n % i == 0 ) { n = n / i ; if ( count . ContainsKey ( i ) ) { count [ i ] = count [ i ] + 1 ; } else { count . Add ( i , 1 ) ; } } } if ( n > 2 ) { if ( count . ContainsKey ( n ) ) { count [ n ] = count [ n ] + 1 ; } else { count . Add ( n , 1 ) ; } } int flag = 0 ; foreach ( KeyValuePair < int , int > b in count ) { if ( b . Value == 1 ) { flag = 1 ; break ; } } if ( flag == 1 ) { return false ; } else { return true ; } } static bool isTrojan ( int n ) { if ( ! isPerfectPower ( n ) && isStrongNumber ( n ) ) { return true ; } else { return false ; } } public static void Main ( String [ ] args ) { int n = 108 ; if ( isTrojan ( n ) ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } }

Index/key variables: i, n
Accumulator variables: i, x, y
Iterator variables: b, i, x
Class/struct names: GFG
C# program:
using System ; class GFG { static void Sum_upto_nth_Term ( int n ) { int r = n * ( n + 1 ) * ( 2 * n + 7 ) / 3 ; Console . Write ( r ) ; } public static void Main ( ) { int N = 5 ; Sum_upto_nth_Term ( N ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int CalculateDifference ( int [ ] arr , int n ) { int max_val = int . MinValue ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] > max_val ) max_val = arr [ i ] ; } bool [ ] prime = new bool [ max_val + 1 ] ; for ( int i = 0 ; i <= max_val ; i ++ ) prime [ i ] = true ; prime [ 0 ] = false ; prime [ 1 ] = false ; for ( int p = 2 ; p * p <= max_val ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * 2 ; i <= max_val ; i += p ) prime [ i ] = false ; } } int S1 = 0 , S2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( prime [ arr [ i ] ] ) { S1 += arr [ i ] ; } else if ( arr [ i ] != 1 ) { S2 += arr [ i ] ; } } return Math . Abs ( S2 - S1 ) ; } public static void Main ( string [ ] args ) { int [ ] arr = { 1 , 3 , 5 , 10 , 15 , 7 } ; int n = arr . Length ; Console . WriteLine ( CalculateDifference ( arr , n ) ) ; } }

Index/key variables: i, p
Accumulator variables: S1, S2, i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { public double sum ( int x , int n ) { double total = 1.0 ; double previous = 1.0 ; for ( int i = 1 ; i <= n ; i ++ ) { previous = ( ( previous * x ) / ( i + 1 ) ) ; total = total + previous ; } return total ; } } class geek { public static void Main ( ) { GFG g = new GFG ( ) ; int x = 5 , n = 4 ; Console . WriteLine ( " Sum ▁ is : ▁ " + g . sum ( x , n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG, geek
C# program:
using System ; class GFG { static int numberOfDivisors ( int num ) { int c = 0 ; for ( int i = 1 ; i <= num ; i ++ ) { if ( num % i == 0 ) { c += 1 ; } } return c ; } static int countNumbers ( int n ) { int c = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { if ( numberOfDivisors ( i ) == 9 ) c += 1 ; } return c ; } public static void Main ( ) { int n = 1000 ; Console . Write ( countNumbers ( n ) ) ; } }

Accumulator variables: c, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int numberOfDistinct ( int n ) { int ans = 0 ; for ( int i = 1 ; i <= Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { ans ++ ; if ( ( n / i ) != i ) ans ++ ; } } return ans ; } static public void Main ( ) { int n = 3 ; Console . WriteLine ( numberOfDistinct ( n ) ) ; } }

Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static readonly int MAX = 1000 ; static List < int > arr = new List < int > ( ) ; static void ulam ( ) { arr . Add ( 1 ) ; arr . Add ( 2 ) ; for ( int i = 3 ; i < MAX ; i ++ ) { int count = 0 ; for ( int j = 0 ; j < arr . Count - 1 ; j ++ ) { for ( int k = j + 1 ; k < arr . Count ; k ++ ) { if ( arr [ j ] + arr [ k ] == i ) { count ++ ; } if ( count > 1 ) break ; } if ( count > 1 ) break ; } if ( count == 1 ) { arr . Add ( i ) ; } } } public static void Main ( String [ ] args ) { ulam ( ) ; int n = 9 ; Console . WriteLine ( arr [ n - 1 ] ) ; } }

Index/key variables: j, k
Accumulator variables: count, i, j, k
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static int NumberOfRectangles ( int n , int m ) { if ( n % 2 == 0 ) return ( n / 2 ) * m ; else if ( m % 2 == 0 ) return ( m / 2 ) * n ; return ( n * m - 1 ) / 2 ; } public static void Main ( ) { int n = 3 , m = 3 ; Console . WriteLine ( NumberOfRectangles ( n , m ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static long findNumUtil ( long res , int a , int aCount , int b , int bCount , int n ) { if ( res > 1e11 ) return ( long ) 1e11 ; if ( aCount == bCount && res >= n ) return res ; return Math . Min ( findNumUtil ( res * 10 + a , a , aCount + 1 , b , bCount , n ) , findNumUtil ( res * 10 + b , a , aCount , b , bCount + 1 , n ) ) ; } static int findNum ( int n , int a , int b ) { int result = 0 ; int aCount = 0 ; int bCount = 0 ; return ( int ) findNumUtil ( result , a , aCount , b , bCount , n ) ; } public static void Main ( ) { int N = 4500 ; int A = 4 ; int B = 7 ; Console . WriteLine ( findNum ( N , A , B ) ) ; } }

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

Class/struct names: GFG
C# program:
using System ; class GFG { public static void Main ( ) { float m = 50 , n = 5 , x = 67 , h = 2927 ; int z = ( int ) ( Math . Ceiling ( ( h / 60 * 1.0 ) ) ) ; if ( z <= n ) Console . WriteLine ( z * m ) ; else Console . WriteLine ( n * m + ( z - n ) * x ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double sumProductDifference ( int a , int b , int c , int d , int e ) { double rootSum = ( double ) ( - 1 * b ) / a ; double rootProduct = ( double ) e / a ; return Math . Abs ( rootSum - rootProduct ) ; } public static void Main ( ) { Console . Write ( sumProductDifference ( 8 , 4 , 6 , 4 , 1 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int numberOfSolutions ( int n ) { int c = 0 ; for ( int x = 0 ; x <= n ; ++ x ) if ( n == x + ( n ^ x ) ) ++ c ; return c ; } public static void Main ( ) { int n = 3 ; Console . Write ( numberOfSolutions ( n ) ) ; } }

Iterator variables: x
Class/struct names: GFG
C# program:
using System ; class GFG { static int minimumLectures ( int m , int n ) { int ans = 0 ; if ( n < ( int ) Math . Ceiling ( 0.75 * m ) ) ans = ( int ) Math . Ceiling ( ( ( 0.75 * m ) - n ) / 0.25 ) ; else ans = 0 ; return ans ; } public static void Main ( ) { int M = 9 , N = 1 ; Console . WriteLine ( minimumLectures ( M , N ) ) ; } }

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

Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 10000 ; static int [ ] prefix = new int [ MAX + 1 ] ; static void buildPrefix ( ) { bool [ ] prime = new bool [ MAX + 1 ] ; for ( int i = 0 ; i < MAX + 1 ; i ++ ) prime [ i ] = true ; for ( int p = 2 ; p * p <= MAX ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * 2 ; i <= MAX ; i += p ) prime [ i ] = false ; } } prefix [ 0 ] = prefix [ 1 ] = 0 ; for ( int p = 2 ; p <= MAX ; p ++ ) { prefix [ p ] = prefix [ p - 1 ] ; if ( prime [ p ] == true ) prefix [ p ] += p ; } } static int sumPrimeRange ( int L , int R ) { buildPrefix ( ) ; return prefix [ R ] - prefix [ L - 1 ] ; } public static void Main ( ) { int L = 10 , R = 20 ; Console . WriteLine ( sumPrimeRange ( L , R ) ) ; } }

Index/key variables: R, i, p
Accumulator variables: i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { static int calculateSum ( int n ) { return 2 * ( n * ( n + 1 ) * ( 2 * n + 1 ) / 6 ) + n * ( n + 1 ) / 2 + 2 * ( n ) ; } public static void Main ( ) { int n = 3 ; Console . WriteLine ( " Sum ▁ = ▁ " + calculateSum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void checkSolution ( int a , int b , int c ) { if ( ( ( b * b ) - ( 4 * a * c ) ) > 0 ) Console . WriteLine ( "2 ▁ solutions " ) ; else if ( ( ( b * b ) - ( 4 * a * c ) ) == 0 ) Console . WriteLine ( "1 ▁ solution " ) ; else Console . WriteLine ( " No ▁ solutions " ) ; } public static void Main ( ) { int a = 2 , b = 5 , c = 2 ; checkSolution ( a , b , c ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static long Bits ( int kilobytes ) { long Bits = 0 ; Bits = kilobytes * 8192 ; return Bits ; } static long Bytes ( int kilobytes ) { long Bytes = 0 ; Bytes = kilobytes * 1024 ; return Bytes ; } static public void Main ( ) { int kilobytes = 1 ; Console . WriteLine ( kilobytes + " ▁ Kilobytes ▁ = ▁ " + Bytes ( kilobytes ) + " ▁ Bytes ▁ and ▁ " + Bits ( kilobytes ) + " ▁ Bits . " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double findSum ( long n ) { return Math . Sqrt ( 3 ) * ( n * ( n + 1 ) / 2 ) ; } public static void Main ( ) { long n = 10 ; Console . WriteLine ( findSum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int sum ( int x , int y , int n ) { int sum1 = ( int ) ( ( Math . Pow ( x , 2 ) * ( Math . Pow ( x , 2 * n ) - 1 ) ) / ( Math . Pow ( x , 2 ) - 1 ) ) ; int sum2 = ( int ) ( ( x * y * ( Math . Pow ( x , n ) * Math . Pow ( y , n ) - 1 ) ) / ( x * y - 1 ) ) ; return sum1 + sum2 ; } public static void Main ( ) { int x = 2 , y = 2 , n = 2 ; Console . Write ( sum ( x , y , n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void printPair ( int g , int l ) { Console . Write ( g + " ▁ " + l ) ; } public static void Main ( ) { int g = 3 , l = 12 ; printPair ( g , l ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int calculateSum ( int n ) { int a1 = 1 , a2 = 2 ; int r = 2 ; int d = 1 ; return ( n ) * ( 2 * a1 + ( n - 1 ) * d ) / 2 + a2 * ( int ) ( Math . Pow ( r , n ) - 1 ) / ( r - 1 ) ; } public static void Main ( ) { int n = 5 ; Console . WriteLine ( " Sum ▁ = ▁ " + calculateSum ( n ) ) ; } }

Class/struct names: GFG