dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static void add ( int [ ] ac , int [ ] x , int qrn ) { int i , c = 0 ; for ( i = 0 ; i < qrn ; i ++ ) { ac [ i ] = ac [ i ] + x [ i ] + c ; if ( ac [ i ] > 1 ) { ac [ i ] = ac [ i ] % 2 ; c = 1 ; } else c = 0 ; } } static void complement ( int [ ] a , int n ) { int i ; int [ ] x = new int [ 8 ] ; Array . Clear ( x , 0 , 8 ) ; x [ 0 ] = 1 ; for ( i = 0 ; i < n ; i ++ ) { a [ i ] = ( a [ i ] + 1 ) % 2 ; } add ( a , x , n ) ; } static void rightShift ( int [ ] ac , int [ ] qr , ref int qn , int qrn ) { int temp , i ; temp = ac [ 0 ] ; qn = qr [ 0 ] ; Console . Write ( " TABSYMBOL TABSYMBOL rightShift TABSYMBOL " ) ; for ( i = 0 ; i < qrn - 1 ; i ++ ) { ac [ i ] = ac [ i + 1 ] ; qr [ i ] = qr [ i + 1 ] ; } qr [ qrn - 1 ] = temp ; } static void display ( int [ ] ac , int [ ] qr , int qrn ) { int i ; for ( i = qrn - 1 ; i >= 0 ; i -- ) Console . Write ( ac [ i ] ) ; Console . Write ( " TABSYMBOL " ) ; for ( i = qrn - 1 ; i >= 0 ; i -- ) Console . Write ( qr [ i ] ) ; } static void boothAlgorithm ( int [ ] br , int [ ] qr , int [ ] mt , int qrn , int sc ) { int qn = 0 ; int [ ] ac = new int [ 10 ] ; Array . Clear ( ac , 0 , 10 ) ; int temp = 0 ; Console . Write ( " qn TABSYMBOL q [ n ▁ + ▁ 1 ] TABSYMBOL BR TABSYMBOL " + " TABSYMBOL AC TABSYMBOL QR TABSYMBOL TABSYMBOL sc STRNEWLINE " ) ; Console . Write ( " TABSYMBOL TABSYMBOL TABSYMBOL initial TABSYMBOL TABSYMBOL " ) ; display ( ac , qr , qrn ) ; Console . Write ( " TABSYMBOL TABSYMBOL " + sc + " STRNEWLINE " ) ; while ( sc != 0 ) { Console . Write ( qr [ 0 ] + " TABSYMBOL " + qn ) ; if ( ( qn + qr [ 0 ] ) == 1 ) { if ( temp == 0 ) { add ( ac , mt , qrn ) ; Console . Write ( " TABSYMBOL TABSYMBOL A ▁ = ▁ A ▁ - ▁ BR TABSYMBOL " ) ; for ( int i = qrn - 1 ; i >= 0 ; i -- ) Console . Write ( ac [ i ] ) ; temp = 1 ; } else if ( temp == 1 ) { add ( ac , br , qrn ) ; Console . Write ( " TABSYMBOL TABSYMBOL A ▁ = ▁ A ▁ + ▁ BR TABSYMBOL " ) ; for ( int i = qrn - 1 ; i >= 0 ; i -- ) Console . Write ( ac [ i ] ) ; temp = 0 ; } Console . Write ( " STRNEWLINE TABSYMBOL " ) ; rightShift ( ac , qr , ref qn , qrn ) ; } else if ( qn - qr [ 0 ] == 0 ) rightShift ( ac , qr , ref qn , qrn ) ; display ( ac , qr , qrn ) ; Console . Write ( " TABSYMBOL " ) ; sc -- ; Console . Write ( " TABSYMBOL " + sc + " STRNEWLINE " ) ; } } static void Main ( ) { int [ ] mt = new int [ 10 ] ; int sc , brn , qrn ; brn = 4 ; int [ ] br = new int [ ] { 0 , 1 , 1 , 0 } ; for ( int i = brn - 1 ; i >= 0 ; i -- ) mt [ i ] = br [ i ] ; Array . Reverse ( br ) ; complement ( mt , brn ) ; qrn = 4 ; sc = qrn ; int [ ] qr = new int [ ] { 1 , 0 , 1 , 0 } ; Array . Reverse ( qr ) ; boothAlgorithm ( br , qr , mt , qrn , sc ) ; Console . WriteLine ( ) ; Console . Write ( " Result ▁ = ▁ " ) ; for ( int i = qrn - 1 ; i >= 0 ; i -- ) Console . Write ( qr [ i ] ) ; } }

Index/key variables: i
Accumulator variables: i, sc
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static List < long > gen ( long n , List < long > r ) { long a = r [ r . Count - 1 ] ; a ++ ; for ( int i = 1 ; i <= n ; a += 2 , i ++ ) r . Add ( a ) ; return r ; } static List < long > conell ( long n ) { List < long > res = new List < long > ( ) ; long k = 1 ; res . Add ( 0 ) ; while ( true ) { res = gen ( k , res ) ; k ++ ; int j = res . Count - 1 ; while ( j != n && j + k > n ) k -- ; if ( j >= n ) break ; } res . RemoveAt ( 0 ) ; return res ; } static void Main ( ) { long n = 10 ; Console . WriteLine ( " The ▁ first ▁ " + n + " ▁ terms ▁ are " ) ; List < long > res = conell ( n ) ; for ( int i = 0 ; i < res . Count ; i ++ ) Console . Write ( res [ i ] + " ▁ " ) ; Console . WriteLine ( ) ; } }

Index/key variables: i
Accumulator variables: a, i, k
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class Program { static long factorial ( int n ) { long res = 1 ; for ( int i = 2 ; i <= n ; i ++ ) { res *= i ; } return res ; } static void printNComposite ( int n ) { long fact = factorial ( n + 1 ) ; for ( int i = 2 ; i <= n + 1 ; ++ i ) { Console . Write ( fact + i + " ▁ " ) ; } } public static void Main ( ) { int n = 4 ; printNComposite ( n ) ; } }

Accumulator variables: i, res
Iterator variables: i
Class/struct names: Program
C# program:
using System ; using System . Collections . Generic ; class GFG { static List < long > primes ( long n ) { bool [ ] prime = new bool [ n + 1 ] ; for ( int i = 0 ; i < n + 1 ; i ++ ) prime [ i ] = true ; for ( int i = 2 ; i * i <= n ; i ++ ) { if ( prime [ i ] == true ) { for ( int j = i * 2 ; j <= n ; j += i ) prime [ j ] = false ; } } List < long > arr = new List < long > ( ) ; for ( int i = 2 ; i < n ; i ++ ) if ( prime [ i ] ) arr . Add ( i ) ; return arr ; } static int countDigits ( long n ) { long temp = n ; int c = 0 ; while ( temp != 0 ) { temp = temp / 10 ; c ++ ; } return c ; } static bool frugal ( long n ) { List < long > r = primes ( n ) ; long t = n ; long s = 0 ; for ( int i = 0 ; i < r . Count ; i ++ ) { if ( t % r [ i ] == 0 ) { long k = 0 ; while ( t % r [ i ] == 0 ) { t = t / r [ i ] ; k ++ ; } if ( k == 1 ) s = s + countDigits ( r [ i ] ) ; else if ( k != 1 ) s = s + countDigits ( r [ i ] ) + countDigits ( k ) ; } } return ( countDigits ( n ) > s && s != 0 ) ; } static void Main ( ) { long n = 343 ; if ( frugal ( n ) ) Console . Write ( " A ▁ Frugal ▁ number STRNEWLINE " ) ; else Console . Write ( " Not ▁ a ▁ frugal ▁ number STRNEWLINE " ) ; } }

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

Class/struct names: GFG
C# program:
using System ; class GFG { public static int findS ( int s ) { int sum = 0 ; for ( int n = 1 ; sum < s ; n ++ ) { sum += n * n * n ; if ( sum == s ) return n ; } return - 1 ; } static public void Main ( string [ ] args ) { int s = 9 ; int n = findS ( s ) ; if ( n == - 1 ) Console . WriteLine ( " - 1" ) ; else Console . WriteLine ( n ) ; } }

Accumulator variables: n, sum
Iterator variables: n
Class/struct names: GFG
C# program:
using System ; class GFG { public static int findKthGoodNo ( int n ) { int lastDig = n % 10 ; if ( lastDig >= 0 && lastDig <= 4 ) return n << 1 ; else return ( n << 1 ) + 1 ; } static public void Main ( string [ ] args ) { int n = 10 ; Console . WriteLine ( findKthGoodNo ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void NicomachuTheorum_sum ( int n ) { int sum = 0 ; for ( int k = 1 ; k <= n ; k ++ ) sum += k * k * k ; int triNo = n * ( n + 1 ) / 2 ; if ( sum == triNo * triNo ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } public static void Main ( ) { int n = 5 ; NicomachuTheorum_sum ( n ) ; } }

Accumulator variables: k, sum
Iterator variables: k
Class/struct names: GFG
C# program:
using System ; public class GFG { static int checkDigits ( int n ) { while ( n > 0 ) { if ( ( ( n % 10 ) % 2 ) > 0 ) return 0 ; n /= 10 ; } return 1 ; } static int largestNumber ( int n ) { for ( int i = n ; ; i -- ) if ( checkDigits ( i ) > 0 ) return i ; } static public 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 + 8 ; 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 countDigits ( int n ) { return ( int ) ( n * Math . Log10 ( 2 ) + 1 ) ; } static void Main ( ) { int n = 5 ; Console . Write ( countDigits ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int check_digits ( int n ) { while ( n != 0 ) { if ( ( n % 10 ) % 2 != 0 ) return 0 ; n /= 10 ; } return 1 ; } static int smallest_number ( int n ) { for ( int i = n ; ; i ++ ) if ( check_digits ( i ) != 0 ) return i ; } public static void Main ( ) { int N = 2397 ; Console . WriteLine ( smallest_number ( N ) ) ; } }

Accumulator variables: i, n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findBucketNo ( int p ) { return ( int ) Math . Ceiling ( ( Math . Sqrt ( 8 * p + 1 ) - 1 ) / 2 ) ; } static public void Main ( ) { int p = 10 ; Console . WriteLine ( findBucketNo ( p ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int factorial ( int n ) { if ( n == 0 ) return 1 ; return n * factorial ( n - 1 ) ; } static int LCMOfNeighbourFact ( int n ) { return factorial ( n + 1 ) ; } public static void Main ( ) { int N = 5 ; Console . WriteLine ( LCMOfNeighbourFact ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections ; class GFG { static int MAX = 50002 ; static ArrayList primes = new ArrayList ( ) ; public static void sieve ( ) { bool [ ] isPrime = new bool [ MAX ] ; for ( int i = 0 ; i < MAX ; i ++ ) isPrime [ i ] = true ; for ( int p = 2 ; p * p < MAX ; p ++ ) { if ( isPrime [ p ] == true ) { for ( int i = p * 2 ; i < MAX ; i += p ) isPrime [ i ] = false ; } } for ( int p = 2 ; p < MAX ; p ++ ) if ( isPrime [ p ] == true ) primes . Add ( p ) ; } public static int power_prime ( int x , int y ) { int count = 0 ; int z = y ; while ( x >= z ) { count += ( x / z ) ; z *= y ; } return count ; } public static int modMult ( int a , int b , int mod ) { int res = 0 ; a = a % mod ; while ( b > 0 ) { if ( b % 2 == 1 ) res = ( res + a ) % mod ; a = ( a * 2 ) % mod ; b /= 2 ; } return res % mod ; } public static int countWays ( int n , int m ) { int ans = 1 ; for ( int i = 1 ; i < primes . Count ; i ++ ) { int powers = power_prime ( n , Convert . ToInt32 ( primes [ i ] ) ) ; if ( powers == 0 ) break ; ans = modMult ( ans , powers + 1 , m ) % m ; } if ( ( ( ans - 1 ) % m ) < 0 ) return ( ans - 1 + m ) % m ; else return ( ans - 1 ) % m ; } public static void Main ( ) { sieve ( ) ; int n = 4 , m = 7 ; Console . WriteLine ( countWays ( n , m ) ) ; } }

Index/key variables: MAX, i, p
Accumulator variables: b, count, i, p, z
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { 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 int gcd ( int a , int b ) { if ( a == 0 ) return b ; return gcd ( b % a , a ) ; } static bool checkFriendly ( int n , int m ) { int sumFactors_n = sumofFactors ( n ) ; int sumFactors_m = sumofFactors ( m ) ; int gcd_n = gcd ( n , sumFactors_n ) ; int gcd_m = gcd ( m , sumFactors_m ) ; if ( n / gcd_n == m / gcd_m && sumFactors_n / gcd_n == sumFactors_m / gcd_m ) return true ; else return false ; } public static void Main ( String [ ] args ) { int n = 6 , m = 28 ; if ( checkFriendly ( n , m ) ) Console . Write ( " Yes STRNEWLINE " ) ; else Console . Write ( " No STRNEWLINE " ) ; } }

Accumulator variables: count, curr_sum, curr_term, i, res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public 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 ; } public static int primorial ( int n ) { int p = 2 ; n -- ; for ( int i = 3 ; n != 0 ; i ++ ) { if ( isPrime ( i ) == true ) { p = p * i ; n -- ; } i ++ ; } return p ; } public static int findNextPrime ( int n ) { int nextPrime = n + 2 ; while ( true ) { if ( isPrime ( nextPrime ) == true ) break ; nextPrime ++ ; } return nextPrime ; } public static int fortunateNumber ( int n ) { int p = primorial ( n ) ; return findNextPrime ( p ) - p ; } public static void Main ( ) { int n = 5 ; Console . WriteLine ( fortunateNumber ( n ) ) ; } }

Accumulator variables: i, n, nextPrime
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static double procal ( int n ) { return ( 3.0 * n ) / ( 4.0 * ( n * n ) - 1 ) ; } public static void Main ( ) { int [ ] a = { 1 , 2 , 3 , 4 , 5 } ; int n = a . Length ; Console . Write ( Math . Round ( procal ( n ) * 1000000.0 ) / 1000000.0 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void testSomeNumbers ( int limit , int n ) { if ( n < 3 ) return ; for ( int a = 1 ; a <= limit ; a ++ ) for ( int b = a ; b <= limit ; b ++ ) { int pow_sum = ( int ) ( Math . Pow ( a , n ) + Math . Pow ( b , n ) ) ; double c = Math . Pow ( pow_sum , 1.0 / n ) ; int c_pow = ( int ) Math . Pow ( ( int ) c , n ) ; if ( c_pow == pow_sum ) { Console . WriteLine ( " Count ▁ example ▁ found " ) ; return ; } } Console . WriteLine ( " No ▁ counter ▁ example ▁ within " + " ▁ given ▁ range ▁ and ▁ data " ) ; } public static void Main ( ) { testSomeNumbers ( 12 , 3 ) ; } }

Accumulator variables: a, b
Iterator variables: a, b
Class/struct names: GFG
C# program:
using System ; class GFG { static int gcd ( int a , int b ) { if ( a == 0 ) return b ; return gcd ( b % a , a ) ; } static void productReduce ( int n , int [ ] num , int [ ] den ) { int new_num = 1 , new_den = 1 ; for ( int i = 0 ; i < n ; i ++ ) { new_num *= num [ i ] ; new_den *= den [ i ] ; } int GCD = gcd ( new_num , new_den ) ; new_num /= GCD ; new_den /= GCD ; Console . WriteLine ( new_num + " / " + new_den ) ; } public static void Main ( ) { int n = 3 ; int [ ] num = { 1 , 2 , 5 } ; int [ ] den = { 2 , 1 , 6 } ; productReduce ( n , num , den ) ; } }

Index/key variables: i
Accumulator variables: i, new_den, new_num
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int fnMod ( int n ) { if ( n % 5 == 1 ) return 4 ; else return 0 ; } public static void Main ( ) { int n = 10 ; Console . WriteLine ( fnMod ( n ) ) ; n = 11 ; Console . WriteLine ( fnMod ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int digSum ( int n ) { if ( n == 0 ) return 0 ; return ( n % 9 == 0 ) ? 9 : ( n % 9 ) ; } static int repeatedNumberSum ( int n , int x ) { int sum = x * digSum ( n ) ; return digSum ( sum ) ; } public static void Main ( ) { int n = 24 , x = 3 ; Console . Write ( repeatedNumberSum ( n , x ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int totalSumDivisibleByNum ( int n , int number ) { int firstnum = ( int ) Math . Pow ( 10 , n - 1 ) ; int lastnum = ( int ) Math . Pow ( 10 , n ) ; int sum = 0 ; for ( int i = firstnum ; i < lastnum ; i ++ ) if ( i % number == 0 ) sum += i ; return sum ; } public static void Main ( ) { int n = 3 , num = 7 ; Console . WriteLine ( totalSumDivisibleByNum ( n , num ) ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections ; using System . Collections . Generic ; class GFG { static string fractionToDecimal ( int numerator , int denominator ) { string res = " " ; Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; int rem = numerator % denominator ; while ( ( rem != 0 ) && ! mp . ContainsKey ( rem ) ) { mp [ rem ] = res . Length ; rem = rem * 10 ; int res_part = rem / denominator ; res += res_part + " " ; rem = rem % denominator ; } return ( rem == 0 ) ? " - 1" : res . Substring ( mp [ rem ] ) ; } static bool isPrime ( int n ) { for ( int i = 2 ; i <= n / 2 ; i ++ ) if ( n % i == 0 ) return false ; return true ; } static void ExtendedMidys ( string str , int n , int m ) { if ( ! isPrime ( n ) ) { Console . Write ( " Denominator ▁ is ▁ not ▁ prime , ▁ " + " thus ▁ Extended ▁ Midy ' s ▁ theorem ▁ " + " is ▁ not ▁ applicable " ) ; return ; } int l = str . Length ; if ( l % 2 == 0 && l % m == 0 ) { int [ ] part = new int [ m ] ; int sum = 0 , res = 0 ; for ( int i = 0 ; i < l ; i ++ ) { int var = i / m ; part [ var ] = part [ var ] * 10 + ( str [ i ] - '0' ) ; } for ( int i = 0 ; i < m ; i ++ ) { sum = sum + part [ i ] ; Console . Write ( part [ i ] + " ▁ " ) ; } Console . WriteLine ( ) ; res = ( int ) Math . Pow ( 10 , m ) - 1 ; if ( sum % res == 0 ) Console . Write ( " Extended ▁ Midy ' s ▁ " + " theorem ▁ holds ! " ) ; else Console . Write ( " Extended ▁ Midy ' s ▁ " + " theorem ▁ doesn ' t ▁ hold ! " ) ; } else if ( l % 2 != 0 ) { Console . Write ( " The ▁ repeating ▁ decimal ▁ is ▁ of ▁ " + " odd ▁ length ▁ thus ▁ Extended ▁ Midy ' s ▁ " + " theorem ▁ is ▁ not ▁ applicable " ) ; } else if ( l % m != 0 ) { Console . Write ( " The ▁ repeating ▁ decimal ▁ can ▁ " + " not ▁ be ▁ divided ▁ into ▁ m ▁ digits " ) ; } } public static void Main ( string [ ] args ) { int numr = 1 , denr = 17 , m = 4 ; string res = fractionToDecimal ( numr , denr ) ; if ( res == " - 1" ) Console . Write ( " The ▁ fraction ▁ does ▁ not ▁ " + " have ▁ repeating ▁ decimal " ) ; else { Console . WriteLine ( " Repeating ▁ decimal ▁ = ▁ " + res ) ; ExtendedMidys ( res , denr , m ) ; } } }

Index/key variables: i, m, rem
Accumulator variables: i, res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int numberofterm ( int n , int number ) { int firstnum = ( int ) Math . Pow ( 10 , n - 1 ) ; int lastnum = ( int ) Math . Pow ( 10 , n ) ; int count = 0 ; for ( int i = firstnum ; i < lastnum ; i ++ ) if ( i % number == 0 ) count ++ ; return count ; } public static void Main ( ) { int n = 3 , num = 7 ; Console . Write ( numberofterm ( n , num ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void georgeCantor ( int n ) { int i = 1 ; int j = 1 ; int k = 1 ; while ( k < n ) { j ++ ; k ++ ; if ( k == n ) break ; while ( j > 1 && k < n ) { i ++ ; j -- ; k ++ ; } if ( k == n ) break ; i ++ ; k ++ ; if ( k == n ) break ; while ( i > 1 && k < n ) { i -- ; j ++ ; k ++ ; } } Console . WriteLine ( " N - th ▁ term ▁ : ▁ " + i + " / " + j ) ; } public static void Main ( ) { int n = 15 ; georgeCantor ( n ) ; } }

Accumulator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isDivisible ( long n ) { while ( n / 100 > 0 ) { int last_digit = ( int ) n % 10 ; n /= 10 ; n += last_digit * 3 ; } return ( n % 29 == 0 ) ; } public static void Main ( ) { long n = 348 ; if ( isDivisible ( n ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: n
Class/struct names: GFG
C# program:
using System ; class GFG { static string solveEquation ( string equation ) { int n = equation . Length , sign = 1 , coeff = 0 ; int total = 0 , i = 0 ; for ( int j = 0 ; j < n ; j ++ ) { if ( equation [ j ] == ' + ' equation [ j ] == ' - ' ) { if ( j > i ) total += sign * Int32 . Parse ( equation . Substring ( i , j - i ) ) ; i = j ; } else if ( equation [ j ] == ' x ' ) { if ( ( i == j ) equation [ j - 1 ] == ' + ' ) coeff += sign ; else if ( equation [ j - 1 ] == ' - ' ) coeff -= sign ; else coeff += sign * Int32 . Parse ( equation . Substring ( i , j - i ) ) ; i = j + 1 ; } else if ( equation [ j ] == ' = ' ) { if ( j > i ) total += sign * Int32 . Parse ( equation . Substring ( i , j - i ) ) ; sign = - 1 ; i = j + 1 ; } } if ( i < n ) total += sign * Int32 . Parse ( equation . Substring ( i ) ) ; if ( coeff == 0 && total == 0 ) return " Infinite ▁ solutions " ; if ( coeff == 0 && total != 0 ) return " No ▁ solution " ; int ans = - total / coeff ; return " x ▁ = ▁ " + ans . ToString ( ) ; } static void Main ( ) { string equation = " x + 5-3 + x = 6 + x - 2" ; Console . Write ( solveEquation ( equation ) ) ; } }

Index/key variables: j
Accumulator variables: coeff, j, total
Iterator variables: j
Class/struct names: GFG
C# program:
using System ; class GFG { static bool pronic_check ( int n ) { int x = ( int ) ( Math . Sqrt ( n ) ) ; if ( x * ( x + 1 ) == n ) return true ; else return false ; } public static void Main ( ) { int n = 56 ; if ( pronic_check ( n ) == true ) Console . Write ( " YES " ) ; else Console . Write ( " NO " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void checkperfectsquare ( int n ) { if ( Math . Ceiling ( ( double ) Math . Sqrt ( n ) ) == Math . Floor ( ( double ) Math . Sqrt ( n ) ) ) { Console . Write ( " perfect ▁ square " ) ; } else { Console . Write ( " not ▁ a ▁ perfect ▁ square " ) ; } } public static void Main ( ) { int n = 49 ; checkperfectsquare ( n ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 100000 ; static int multiply ( int x , int [ ] res , int res_size ) { int carry = 0 ; for ( int i = 0 ; i < res_size ; i ++ ) { int prod = res [ i ] * x + carry ; res [ i ] = prod % 10 ; carry = prod / 10 ; } while ( carry > 0 ) { res [ res_size ] = carry % 10 ; carry = carry / 10 ; res_size ++ ; } return res_size ; } static void power ( int x , int n ) { if ( n == 0 ) { Console . Write ( "1" ) ; return ; } int [ ] res = new int [ MAX ] ; int res_size = 0 ; int temp = x ; while ( temp != 0 ) { res [ res_size ++ ] = temp % 10 ; temp = temp / 10 ; } for ( int i = 2 ; i <= n ; i ++ ) res_size = multiply ( x , res , res_size ) ; Console . Write ( x + " ^ " + n + " ▁ = ▁ " ) ; for ( int i = res_size - 1 ; i >= 0 ; i -- ) Console . Write ( res [ i ] ) ; } public static void Main ( ) { int exponent = 100 ; int b_ase = 2 ; power ( b_ase , exponent ) ; } }

Index/key variables: MAX, i, res_size
Accumulator variables: i, res_size
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool check ( int n , int p ) { int maximum = - 1 ; while ( ( n % 2 ) == 0 ) { maximum = Math . Max ( maximum , 2 ) ; n = n / 2 ; } for ( int i = 3 ; i <= Math . Sqrt ( n ) ; i += 2 ) { while ( n % i == 0 ) { maximum = Math . Max ( maximum , i ) ; n = n / i ; } } if ( n > 2 ) maximum = Math . Max ( maximum , n ) ; return ( maximum <= p ) ; } public static void Main ( ) { int n = 24 , p = 7 ; if ( check ( n , p ) ) Console . Write ( " yes " ) ; else Console . Write ( " no " ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void rgb_to_hsv ( double r , double g , double b ) { r = r / 255.0 ; g = g / 255.0 ; b = b / 255.0 ; double h = - 1 , s = - 1 ; if ( cmax == cmin ) h = 0 ; else if ( cmax == r ) h = ( 60 * ( ( g - b ) / diff ) + 360 ) % 360 ; else if ( cmax == g ) h = ( 60 * ( ( b - r ) / diff ) + 120 ) % 360 ; else if ( cmax == b ) h = ( 60 * ( ( r - g ) / diff ) + 240 ) % 360 ; if ( cmax == 0 ) s = 0 ; else s = ( diff / cmax ) * 100 ; double v = cmax * 100 ; Console . WriteLine ( " ( " + h + " ▁ " + s + " ▁ " + v + " ) " ) ; } public static void Main ( String [ ] args ) { rgb_to_hsv ( 129 , 88 , 47 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void find_time ( int h1 ) { int theta = 30 * h1 ; Console . WriteLine ( " ( " + theta * 2 + " / " + " ▁ 11 ▁ ) minutes " ) ; } public static void Main ( ) { int h1 = 3 ; find_time ( h1 ) ; } }

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

Class/struct names: GFG