dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static void printMatrix ( int n ) { float [ , ] H = new float [ n , n ] ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { H [ i , j ] = ( float ) 1.0 / ( ( i + 1 ) + ( j + 1 ) - ( float ) 1.0 ) ; } } for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) Console . Write ( H [ i , j ] + " ▁ " ) ; Console . WriteLine ( " " ) ; } } public static void Main ( ) { int n = 3 ; printMatrix ( n ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int gcd ( int a , int b ) { if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } static int maxDivisorRange ( int a , int b , int l , int h ) { int g = gcd ( a , b ) ; int res = - 1 ; for ( int i = l ; i * i <= g && i <= h ; i ++ ) if ( g % i == 0 ) res = Math . Max ( res , Math . Max ( i , g / i ) ) ; return res ; } public static void Main ( ) { int a = 3 , b = 27 , l = 1 , h = 5 ; Console . WriteLine ( maxDivisorRange ( a , b , l , h ) ) ; } }

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

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void checksum ( int n ) { if ( n % 5 == 0 ) Console . WriteLine ( ( n / 5 - 2 ) + " ▁ " + ( n / 5 - 1 ) + " ▁ " + ( n / 5 ) + " ▁ " + ( n / 5 + 1 ) + " ▁ " + ( n / 5 + 2 ) ) ; else Console . WriteLine ( " - 1" ) ; } public static void Main ( ) { int n = 15 ; checksum ( n ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int N = 1000001 ; static int [ ] visited = new int [ N ] ; static int [ ] goesTo = new int [ N ] ; static int dfs ( int i ) { if ( visited [ i ] == 1 ) return 0 ; visited [ i ] = 1 ; int x = dfs ( goesTo [ i ] ) ; return ( x + 1 ) ; } static int noOfTranspositions ( int [ ] P , int n ) { for ( int i = 1 ; i <= n ; i ++ ) visited [ i ] = 0 ; for ( int i = 0 ; i < n ; i ++ ) goesTo [ P [ i ] ] = i + 1 ; int transpositions = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { if ( visited [ i ] == 0 ) { int ans = dfs ( i ) ; transpositions += ans - 1 ; } } return transpositions ; } public static void Main ( ) { int [ ] permutation = { 5 , 1 , 4 , 3 , 2 } ; int n = permutation . Length ; Console . WriteLine ( noOfTranspositions ( permutation , n ) ) ; } }

Index/key variables: N, i
Accumulator variables: i, transpositions
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int sumOfSeries ( int n ) { int ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) ans += i * i * i * i ; return ans ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( sumOfSeries ( n ) ) ; } }

Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countUnmarked ( int N ) { if ( N % 2 == 0 ) return N / 2 ; else return N / 2 + 1 ; } public static void Main ( ) { int N = 4 ; Console . WriteLine ( " Number ▁ of ▁ unmarked ▁ " + " elements : ▁ " + countUnmarked ( N ) ) ; } }

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

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

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int getSum ( int n ) { for ( int i = 1 ; i <= ( int ) Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { if ( n / i == i ) { sum = sum + i ; } { sum = sum + i ; sum = sum + ( n / i ) ; } } } return sum - n ; } static int getAliquot ( int n ) { HashSet < int > s = new HashSet < int > ( ) ; s . Add ( n ) ; while ( n > 0 ) { n = getSum ( n ) ; if ( s . Contains ( n ) ) { return n ; } s . Add ( n ) ; } return 0 ; } static bool isPerfect ( int n ) { int sum = 1 ; for ( int i = 2 ; i * i <= n ; i ++ ) { if ( n % i == 0 ) { sum = sum + i + n / i ; } } if ( sum == n && n != 1 ) { return true ; } return false ; } static bool isAspiring ( int n ) { int alq = getAliquot ( n ) ; if ( isPerfect ( alq ) && ! isPerfect ( n ) ) { return true ; } else { return false ; } } public static void Main ( String [ ] args ) { int n = 25 ; if ( isAspiring ( n ) ) { Console . WriteLine ( " Aspiring " ) ; } else { Console . WriteLine ( " Not ▁ Aspiring " ) ; } } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int minimumLength ( int x , int y , int z ) { return 1 + Math . Abs ( x - y ) + Math . Abs ( y - z ) ; } public static void Main ( ) { int x = 3 , y = 1 , z = 2 ; Console . WriteLine ( minimumLength ( x , y , z ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void endPointOfDiameterofCircle ( int x1 , int y1 , int c1 , int c2 ) { Console . Write ( " x2 ▁ = ▁ " + ( 2 * c1 - x1 ) + " ▁ " ) ; Console . Write ( " y2 ▁ = ▁ " + ( 2 * c2 - y1 ) ) ; } public static void Main ( ) { int x1 = - 4 , y1 = - 1 ; int c1 = 3 , c2 = 5 ; endPointOfDiameterofCircle ( x1 , y1 , c1 , c2 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float proterm ( int i , float value , float [ ] x ) { float pro = 1 ; for ( int j = 0 ; j < i ; j ++ ) { pro = pro * ( value - x [ j ] ) ; } return pro ; } static void dividedDiffTable ( float [ ] x , float [ , ] y , int n ) { for ( int i = 1 ; i < n ; i ++ ) { for ( int j = 0 ; j < n - i ; j ++ ) { y [ j , i ] = ( y [ j , i - 1 ] - y [ j + 1 , i - 1 ] ) / ( x [ j ] - x [ i + j ] ) ; } } } static float applyFormula ( float value , float [ ] x , float [ , ] y , int n ) { float sum = y [ 0 , 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { sum = sum + ( proterm ( i , value , x ) * y [ 0 , i ] ) ; } return sum ; } static void printDiffTable ( float [ , ] y , int n ) { for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n - i ; j ++ ) { Console . Write ( Math . Round ( y [ i , j ] , 4 ) + " TABSYMBOL ▁ " ) ; } Console . WriteLine ( " " ) ; } } public static void Main ( ) { int n = 4 ; float value ; float [ , ] y = new float [ 10 , 10 ] ; float [ ] x = { 5 , 6 , 9 , 11 } ; y [ 0 , 0 ] = 12 ; y [ 1 , 0 ] = 13 ; y [ 2 , 0 ] = 14 ; y [ 3 , 0 ] = 16 ; dividedDiffTable ( x , y , n ) ; printDiffTable ( y , n ) ; value = 7 ; Console . WriteLine ( " STRNEWLINE Value ▁ at ▁ " + ( value ) + " ▁ is ▁ " + Math . Round ( applyFormula ( value , x , y , n ) , 2 ) ) ; } }

Index/key variables: j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static long centered_heptagonal_num ( long n ) { return ( 7 * n * n - 7 * n + 2 ) / 2 ; } public static void Main ( ) { long n = 5 ; Console . WriteLine ( n + " th ▁ Centered ▁ " + " heptagonal ▁ number ▁ : ▁ " + centered_heptagonal_num ( n ) ) ; } }

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

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool checkHankelMatrix ( int n , int [ , ] m ) { for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( i + j < n ) { if ( m [ i , j ] != m [ i + j , 0 ] ) return false ; } else { if ( m [ i , j ] != m [ i + j - n + 1 , n - 1 ] ) return false ; } } } return true ; } public static void Main ( ) { int n = 4 ; int [ , ] m = { { 1 , 2 , 3 , 5 } , { 2 , 3 , 5 , 8 } , { 3 , 5 , 8 , 0 } , { 5 , 8 , 0 , 9 } } ; if ( checkHankelMatrix ( n , m ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPower ( int n ) { for ( int x = 2 ; x <= ( int ) Math . Sqrt ( n ) ; x ++ ) { float f = ( float ) Math . Log ( n ) / ( float ) Math . Log ( x ) ; if ( ( f - ( int ) f ) == 0.0 ) return true ; } return false ; } public static void Main ( ) { for ( int i = 2 ; i < 100 ; i ++ ) if ( isPower ( i ) ) Console . Write ( i + " ▁ " ) ; } }

Accumulator variables: i, x
Iterator variables: i, x
Class/struct names: GFG
C# program:
using System ; class GFG { static int N = 1000005 ; static void sumOddDigit ( int [ ] digitSum ) { for ( int i = 1 ; i < N ; i ++ ) { digitSum [ i ] = digitSum [ i / 10 ] + ( i & 1 ) * ( i % 10 ) ; } } static void sumFactor ( int [ ] digitSum , int [ ] factorDigitSum ) { for ( int i = 1 ; i < N ; i ++ ) { for ( int j = i ; j < N ; j += i ) { factorDigitSum [ j ] += digitSum [ i ] ; } } } static void wrapper ( int q , int [ ] n ) { int [ ] digitSum = new int [ N ] ; int [ ] factorDigitSum = new int [ N ] ; sumOddDigit ( digitSum ) ; sumFactor ( digitSum , factorDigitSum ) ; for ( int i = 0 ; i < q ; i ++ ) Console . Write ( factorDigitSum [ n [ i ] ] + " ▁ " ) ; } public static void Main ( ) { int q = 2 ; int [ ] n = new int [ ] { 10 , 36 } ; wrapper ( q , n ) ; } }

Index/key variables: N, i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int M = 10 ; static void PrintMatrix ( float [ , ] a , int n ) { for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j <= n ; j ++ ) Console . Write ( a [ i , j ] + " ▁ " ) ; Console . WriteLine ( ) ; } } static int PerformOperation ( float [ , ] a , int n ) { int i , j , k = 0 , c , flag = 0 ; for ( i = 0 ; i < n ; i ++ ) { if ( a [ i , i ] == 0 ) { c = 1 ; while ( ( i + c ) < n && a [ i + c , i ] == 0 ) c ++ ; if ( ( i + c ) == n ) { flag = 1 ; break ; } for ( j = i , k = 0 ; k <= n ; k ++ ) { float temp = a [ j , k ] ; a [ j , k ] = a [ j + c , k ] ; a [ j + c , k ] = temp ; } } for ( j = 0 ; j < n ; j ++ ) { if ( i != j ) { float p = a [ j , i ] / a [ i , i ] ; for ( k = 0 ; k <= n ; k ++ ) a [ j , k ] = a [ j , k ] - ( a [ i , k ] ) * p ; } } } return flag ; } static void PrintResult ( float [ , ] a , int n , int flag ) { Console . Write ( " Result ▁ is ▁ : ▁ " ) ; if ( flag == 2 ) Console . WriteLine ( " Infinite ▁ Solutions ▁ Exists " ) ; else if ( flag == 3 ) Console . WriteLine ( " No ▁ Solution ▁ Exists " ) ; else { for ( int i = 0 ; i < n ; i ++ ) Console . Write ( a [ i , n ] / a [ i , i ] + " ▁ " ) ; } } static int CheckConsistency ( float [ , ] a , int n , int flag ) { int i , j ; float sum ; flag = 3 ; for ( i = 0 ; i < n ; i ++ ) { sum = 0 ; for ( j = 0 ; j < n ; j ++ ) sum = sum + a [ i , j ] ; if ( sum == a [ i , j ] ) flag = 2 ; } return flag ; } public static void Main ( String [ ] args ) { float [ , ] a = { { 0 , 2 , 1 , 4 } , { 1 , 1 , 2 , 6 } , { 2 , 1 , 1 , 7 } } ; int n = 3 , flag = 0 ; flag = PerformOperation ( a , n ) ; if ( flag == 1 ) flag = CheckConsistency ( a , n , flag ) ; Console . WriteLine ( " Final ▁ Augumented ▁ Matrix ▁ is ▁ : ▁ " ) ; PrintMatrix ( a , n ) ; Console . WriteLine ( " " ) ; PrintResult ( a , n , flag ) ; } }

Accumulator variables: c, i, j, k
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; public class GFG { static int number_of_digits ( int n ) { int i ; int res ; int sum = 0 ; for ( i = 4 , res = 1 ; ; i *= 4 , res ++ ) { sum += i ; if ( sum >= n ) break ; } return res ; } static public void Main ( ) { int n = 21 ; Console . WriteLine ( number_of_digits ( n ) ) ; } }

Accumulator variables: i, res, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void reverseorder ( int n ) { bool [ ] prime = new bool [ n + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) prime [ i ] = true ; for ( int p = 2 ; p * p <= n ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * 2 ; i <= n ; i += p ) prime [ i ] = false ; } } for ( int i = n ; i >= 2 ; i -- ) if ( prime [ i ] == true ) Console . Write ( i + " ▁ " ) ; } public static void Main ( ) { int N = 25 ; Console . WriteLine ( " Prime ▁ number ▁ in " + " ▁ reverse ▁ order " ) ; if ( N == 1 ) Console . WriteLine ( " No ▁ prime ▁ no " + " ▁ exist ▁ in ▁ this ▁ range " ) ; else reverseorder ( N ) ; } }

Index/key variables: i, p
Accumulator variables: i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { static void checkVantieghemsTheorem ( int limit ) { long prod = 1 ; for ( long n = 2 ; n < limit ; n ++ ) { if ( ( ( prod - n < 0 ? 0 : prod - n ) % ( ( 1 << ( int ) n ) - 1 ) ) == 0 ) Console . Write ( n + " ▁ is ▁ prime STRNEWLINE " ) ; prod *= ( ( 1 << ( int ) n ) - 1 ) ; } } public static void Main ( ) { checkVantieghemsTheorem ( 10 ) ; } }

Accumulator variables: n, prod
Iterator variables: n
Class/struct names: GFG
C# program:
using System ; class GFG { static int mod = ( int ) ( 1e9 + 7 ) ; static int N = 1000005 ; static int [ ] fact = new int [ N ] ; static int [ ] invfact = new int [ N ] ; static int check ( int x , int a , int b ) { if ( x == 0 ) { return 0 ; } while ( x > 0 ) { if ( x % 10 != a & x % 10 != b ) { return 0 ; } x /= 10 ; } return 1 ; } static int modInverse ( int a , int m ) { int m0 = m ; int y = 0 , x = 1 ; if ( m == 1 ) { return 0 ; } while ( a > 1 ) { int q = a / m ; int t = m ; m = a % m ; a = t ; t = y ; y = x - q * y ; x = t ; } if ( x < 0 ) { x += m0 ; } return x ; } static void pregenFact ( ) { fact [ 0 ] = fact [ 1 ] = 1 ; for ( int i = 1 ; i <= 1000000 ; ++ i ) { fact [ i ] = ( int ) ( ( long ) fact [ i - 1 ] * i % mod ) ; } } static void pregenInverse ( ) { invfact [ 0 ] = invfact [ 1 ] = 1 ; invfact [ 1000000 ] = modInverse ( fact [ 1000000 ] , mod ) ; for ( int i = 999999 ; i > 1 ; -- i ) { invfact [ i ] = ( int ) ( ( ( long ) invfact [ i + 1 ] * ( long ) ( i + 1 ) ) % mod ) ; } } static int comb ( int big , int small ) { return ( int ) ( ( long ) fact [ big ] * invfact [ small ] % mod * invfact [ big - small ] % mod ) ; } static int count ( int a , int b , int n ) { pregenFact ( ) ; pregenInverse ( ) ; if ( a == b ) { return ( check ( a * n , a , b ) ) ; } int ans = 0 ; for ( int i = 0 ; i <= n ; ++ i ) { if ( check ( i * a + ( n - i ) * b , a , b ) == 1 ) { ans = ( ans + comb ( n , i ) ) % mod ; } } return ans ; } public static void Main ( String [ ] args ) { int a = 3 , b = 4 , n = 11028 ; Console . WriteLine ( count ( a , b , n ) ) ; } }

Index/key variables: N, big, i, small
Accumulator variables: x
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static int magicOfSequence ( int N ) { int sum = 0 ; for ( int i = 1 ; i <= N ; i ++ ) sum += ( i * i * i + i * 2 ) ; return sum ; } static public void Main ( ) { int N = 4 ; Console . WriteLine ( magicOfSequence ( N ) ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countOddFactors ( long n ) { int odd_factors = 0 ; for ( int i = 1 ; 1 * i * i <= n ; i ++ ) { if ( n % i == 0 ) { if ( 1 * i * i == n ) { if ( ( i & 1 ) == 1 ) odd_factors ++ ; } else { if ( ( i & 1 ) == 1 ) odd_factors ++ ; int factor = ( int ) n / i ; if ( ( factor & 1 ) == 1 ) odd_factors ++ ; } } } return odd_factors - 1 ; } static void Main ( ) { long N = 15 ; Console . WriteLine ( countOddFactors ( N ) ) ; N = 10 ; Console . WriteLine ( countOddFactors ( N ) ) ; } }

Accumulator variables: i, odd_factors
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPossibleToZero ( int [ ] a , int n ) { int even = 0 , odd = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ( i & 1 ) == 0 ) odd += a [ i ] ; else even += a [ i ] ; } return ( odd == even ) ; } static public void Main ( ) { int [ ] arr = { 0 , 1 , 1 , 0 } ; int n = arr . Length ; if ( isPossibleToZero ( arr , n ) ) Console . WriteLine ( " YES " ) ; else Console . WriteLine ( " NO " ) ; } }

Index/key variables: i
Accumulator variables: even, i, odd
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static double PI = 3.142 ; static double cosXSertiesSum ( double x , int n ) { x = x * ( PI / 180.0 ) ; double res = 1 ; double sign = 1 , fact = 1 , pow = 1 ; for ( int i = 1 ; i < 5 ; i ++ ) { sign = sign * - 1 ; fact = fact * ( 2 * i - 1 ) * ( 2 * i ) ; pow = pow * x * x ; res = res + sign * pow / fact ; } return res ; } public static void Main ( ) { float x = 50 ; int n = 5 ; Console . Write ( ( float ) ( cosXSertiesSum ( x , n ) * 1000000 ) / 1000000.00 ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int solve ( int n , int base1 ) { int result = 0 ; while ( n > 0 ) { int remainder = n % base1 ; result = result + remainder ; n = n / base1 ; } return result ; } static void printSumsOfDigits ( int n ) { for ( int base1 = 2 ; base1 < n ; ++ base1 ) Console . Write ( solve ( n , base1 ) + " ▁ " ) ; } public static void Main ( ) { int n = 8 ; printSumsOfDigits ( n ) ; } }

Iterator variables: base1
Class/struct names: GFG
C# program:
using System ; class GFG { static bool check ( int N , int D ) { int temp = ( N * ( N + 1 ) ) / 2 + D ; return ( temp % 2 == 0 ) ; } static public void Main ( ) { int N = 5 ; int M = 7 ; if ( check ( N , M ) ) Console . Write ( " yes " ) ; else Console . Write ( " no " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int perfectSquare ( string s ) { int n = s . Length ; int ans = - 1 ; string num = " " ; for ( int i = 1 ; i < ( 1 << n ) ; i ++ ) { string str = " " ; for ( int j = 0 ; j < n ; j ++ ) { if ( ( ( i >> j ) & 1 ) == 1 ) { str += s [ j ] ; } } if ( str [ 0 ] != '0' ) { int temp = 0 ; for ( int j = 0 ; j < str . Length ; j ++ ) temp = temp * 10 + ( int ) ( str [ j ] - '0' ) ; int k = ( int ) Math . Sqrt ( temp ) ; if ( k * k == temp ) { if ( ans < ( int ) str . Length ) { ans = ( int ) str . Length ; num = str ; } } } } if ( ans == - 1 ) return ans ; else { Console . Write ( num + " ▁ " ) ; return n - ans ; } } public static void Main ( ) { Console . WriteLine ( perfectSquare ( "8314" ) ) ; Console . WriteLine ( perfectSquare ( "753" ) ) ; } }

Index/key variables: j
Accumulator variables: i, j, str
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void printFourSquares ( int a ) { for ( int i = 0 ; i * i <= a ; i ++ ) { for ( int j = i ; j * j <= a ; j ++ ) { for ( int k = j ; k * k <= a ; k ++ ) { for ( int l = k ; l * l <= a ; l ++ ) { if ( i * i + j * j + k * k + l * l == a ) { Console . Write ( a + " ▁ = ▁ " + i + " * " + i + " ▁ + ▁ " + j + " * " + j + " ▁ + ▁ " ) ; Console . Write ( k + " * " + k + " ▁ + ▁ " + l + " * " + l + " STRNEWLINE " ) ; } } } } } } public static void Main ( ) { int a = 74 ; printFourSquares ( a ) ; } }

Accumulator variables: i, j, k, l
Iterator variables: i, j, k, l
Class/struct names: GFG
C# program:
using System ; class GFG { static int exactPrimeFactorCount ( int n ) { int count = 0 ; if ( n % 2 == 0 ) { count ++ ; while ( n % 2 == 0 ) n = n / 2 ; } for ( int i = 3 ; i <= Math . Sqrt ( n ) ; i = i + 2 ) { if ( n % i == 0 ) { count ++ ; while ( n % i == 0 ) n = n / i ; } } if ( n > 2 ) count ++ ; return count ; } public static void Main ( ) { int n = 51242183 ; Console . WriteLine ( " The ▁ number ▁ of " + " ▁ distinct ▁ prime ▁ factors ▁ is / are ▁ " + exactPrimeFactorCount ( n ) ) ; Console . WriteLine ( " The ▁ value ▁ of ▁ " + " log ( log ( n ) ) ▁ is ▁ " + Math . Log ( Math . Log ( n ) ) ) ; } }

Accumulator variables: count
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int no_of_digit ( int a , int b ) { return ( ( int ) ( b * Math . Log10 ( a ) ) + 1 ) ; } public static void Main ( ) { int a = 2 , b = 100 ; Console . Write ( " no . ▁ of ▁ digits ▁ = ▁ " + no_of_digit ( a , b ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool checkSemiprime ( int num ) { int cnt = 0 ; for ( int i = 2 ; cnt < 2 && i * i <= num ; ++ i ) { while ( num % i == 0 ) { num /= i ; ++ cnt ; } } if ( num > 1 ) ++ cnt ; return cnt == 2 ; } static bool isEmirpimes ( int n ) { if ( checkSemiprime ( n ) == false ) return false ; int r = 0 ; for ( int t = n ; t != 0 ; t = t / n ) r = r * 10 + t % 10 ; if ( r == n ) return false ; return ( checkSemiprime ( r ) ) ; } public static void Main ( ) { int n = 15 ; if ( isEmirpimes ( n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: num
Iterator variables: i, t
Class/struct names: GFG