dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static int findRectNum ( int n ) { return n * ( n + 1 ) ; } public static void Main ( ) { int n = 6 ; Console . Write ( findRectNum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class Muller1 { static int MAX_ITERATIONS = 10000 ; static double f ( double x ) { return 1 * Math . Pow ( x , 3 ) + 2 * x * x + 10 * x - 20 ; } static void Muller ( double a , double b , double c ) { int i ; double res ; for ( i = 0 ; ; ++ i ) { double f1 = f ( a ) ; double f2 = f ( b ) ; double f3 = f ( c ) ; double d1 = f1 - f3 ; double d2 = f2 - f3 ; double h1 = a - c ; double h2 = b - c ; double a0 = f3 ; double a1 = ( ( ( d2 * Math . Pow ( h1 , 2 ) ) - ( d1 * Math . Pow ( h2 , 2 ) ) ) / ( ( h1 * h2 ) * ( h1 - h2 ) ) ) ; double a2 = ( ( ( d1 * h2 ) - ( d2 * h1 ) ) / ( ( h1 * h2 ) * ( h1 - h2 ) ) ) ; double x = ( ( - 2 * a0 ) / ( a1 + Math . Abs ( Math . Sqrt ( a1 * a1 - 4 * a0 * a2 ) ) ) ) ; double y = ( ( - 2 * a0 ) / ( a1 - Math . Abs ( Math . Sqrt ( a1 * a1 - 4 * a0 * a2 ) ) ) ) ; if ( x >= y ) res = x + c ; else res = y + c ; double m = res * 100 ; double n = c * 100 ; m = Math . Floor ( m ) ; n = Math . Floor ( n ) ; if ( m == n ) break ; a = b ; b = c ; c = res ; if ( i > MAX_ITERATIONS ) { Console . WriteLine ( " Root ▁ cannot ▁ be ▁ found ▁ using " + " ▁ Muller ' s ▁ method " ) ; break ; } } if ( i <= MAX_ITERATIONS ) Console . WriteLine ( " The ▁ value ▁ of ▁ the ▁ root ▁ is ▁ " + Math . Round ( res , 4 ) ) ; } static void Main ( ) { double a = 0 , b = 1 , c = 2 ; Muller ( a , b , c ) ; } }

Iterator variables: i
Class/struct names: Muller1
C# program:
using System ; using System . Collections ; class GFG { static int MAX = 100001 ; static ArrayList p = new ArrayList ( ) ; static void sieve ( ) { int [ ] isPrime = new int [ MAX + 1 ] ; for ( int i = 2 ; i <= MAX ; i ++ ) { if ( isPrime [ i ] == 0 ) { p . Add ( i ) ; for ( int j = 2 ; i * j <= MAX ; j ++ ) isPrime [ i * j ] = 1 ; } } } static int phi ( int n ) { int res = n ; for ( int i = 0 ; ( int ) p [ i ] * ( int ) p [ i ] <= n ; i ++ ) { if ( n % ( int ) p [ i ] == 0 ) { res -= ( res / ( int ) p [ i ] ) ; while ( n % ( int ) p [ i ] == 0 ) n /= ( int ) p [ i ] ; } } if ( n > 1 ) res -= ( res / n ) ; return res ; } static void Main ( ) { sieve ( ) ; Console . WriteLine ( phi ( 11 ) ) ; Console . WriteLine ( phi ( 21 ) ) ; Console . WriteLine ( phi ( 31 ) ) ; Console . WriteLine ( phi ( 41 ) ) ; Console . WriteLine ( phi ( 51 ) ) ; Console . WriteLine ( phi ( 61 ) ) ; Console . WriteLine ( phi ( 91 ) ) ; Console . WriteLine ( phi ( 101 ) ) ; } }

Index/key variables: i
Accumulator variables: i, j, n, res
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static void nthprimedigitsnumber ( long n ) { long len = 1 ; long prev_count = 0 ; while ( true ) { long curr_count = ( long ) ( prev_count + Math . Pow ( 4 , len ) ) ; if ( prev_count < n && curr_count >= n ) break ; len ++ ; prev_count = curr_count ; } for ( int i = 1 ; i <= len ; i ++ ) { for ( long j = 1 ; j <= 4 ; j ++ ) { if ( prev_count + Math . Pow ( 4 , len - i ) < n ) prev_count += ( long ) Math . Pow ( 4 , len - i ) ; else { if ( j == 1 ) Console . Write ( "2" ) ; else if ( j == 2 ) Console . Write ( "3" ) ; else if ( j == 3 ) Console . Write ( "5" ) ; else if ( j == 4 ) Console . Write ( "7" ) ; break ; } } } Console . WriteLine ( ) ; } public static void Main ( ) { nthprimedigitsnumber ( 10 ) ; nthprimedigitsnumber ( 21 ) ; } }

Accumulator variables: i, j, len, prev_count
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int cassini ( int n ) { return ( n & 1 ) != 0 ? - 1 : 1 ; } public static void Main ( ) { int n = 5 ; Console . Write ( cassini ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool findNoIsDivisibleOrNot ( int [ ] a , int n ) { for ( int i = 0 ; i < a . Length ; i ++ ) { if ( a [ i ] % n != 0 ) return false ; } return true ; } public static void Main ( ) { int [ ] a = { 14 , 12 , 4 , 18 } ; int n = 2 ; if ( findNoIsDivisibleOrNot ( a , n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
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 void printRange ( int n ) { int a = factorial ( n + 2 ) + 2 ; int b = a + n - 1 ; Console . WriteLine ( " [ " + a + " , ▁ " + b + " ] " ) ; } public static void Main ( ) { int n = 3 ; printRange ( n ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static long findMinValue ( long [ ] arr , int n ) { Array . Sort ( arr ) ; for ( int i = 0 ; i < n ; i ++ ) { val += ( double ) ( Math . Log ( ( double ) ( arr [ i ] ) ) ) ; } long left = arr [ 0 ] , right = arr [ n - 1 ] ; long ans = 0 ; while ( left <= right ) { long mid = ( left + right ) / 2 ; double temp = ( double ) n * ( double ) ( Math . Log ( ( double ) ( mid ) ) ) ; if ( val < temp ) { ans = mid ; right = mid - 1 ; } else { left = mid + 1 ; } } return ans ; } static public void Main ( ) { long [ ] arr = { 4 , 2 , 1 , 10 , 6 } ; int n = arr . Length ; Console . WriteLine ( findMinValue ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, val
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class Test { static int sumOfTermsInNthRow ( int n ) { int sum = ( int ) ( n * ( 2 * Math . Pow ( n , 2 ) + 1 ) ) ; return sum ; } public static void Main ( ) { int n = 4 ; Console . Write ( " Sum ▁ of ▁ all ▁ the ▁ terms ▁ in ▁ nth ▁ row ▁ = ▁ " + sumOfTermsInNthRow ( n ) ) ; } }

Class/struct names: Test
C# program:
using System ; public class GFG { static int firstDigit ( int x ) { while ( x >= 10 ) x = x / 10 ; return x ; } public static void Main ( ) { Console . WriteLine ( firstDigit ( 12345 ) ) ; Console . WriteLine ( firstDigit ( 5432 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int getOccurence ( int n , int d ) { int result = 0 ; int itr = d ; while ( itr <= n ) { if ( itr % 10 == d ) result ++ ; if ( itr != 0 && itr / 10 == d ) { result ++ ; itr ++ ; } else if ( itr / 10 == d - 1 ) itr = itr + ( 10 - d ) ; else itr = itr + 10 ; } return result ; } public static void Main ( ) { int n = 11 , d = 1 ; Console . Write ( getOccurence ( n , d ) ) ; } }

Accumulator variables: itr, result
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void printUnique ( int l , int r ) { for ( int i = l ; i <= r ; i ++ ) { String s = String . Join ( " " , i ) ; HashSet < int > uniDigits = new HashSet < int > ( ) ; foreach ( int c in s . ToCharArray ( ) ) uniDigits . Add ( c ) ; if ( s . Length == uniDigits . Count ) { Console . Write ( i + " ▁ " ) ; } } } public static void Main ( String [ ] args ) { int l = 1 , r = 20 ; printUnique ( l , r ) ; } }

Accumulator variables: i
Iterator variables: c, i
Class/struct names: GFG
C# program:
using System ; class GFG { static void cal_cos ( float n ) { float accuracy = ( float ) 0.0001 , x1 , denominator , cosx , cosval ; n = n * ( float ) ( 3.142 / 180.0 ) ; x1 = 1 ; cosx = x1 ; cosval = ( float ) Math . Cos ( n ) ; int i = 1 ; do { denominator = 2 * i * ( 2 * i - 1 ) ; x1 = - x1 * n * n / denominator ; cosx = cosx + x1 ; i = i + 1 ; } while ( accuracy <= cosval - cosx ) ; Console . WriteLine ( cosx ) ; } static void Main ( ) { float n = 30 ; cal_cos ( n ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections ; class GFG { static ArrayList v = new ArrayList ( ) ; static void multiply ( int x ) { int carry = 0 ; int size = v . Count ; for ( int i = 0 ; i < size ; i ++ ) { int res = carry + ( int ) v [ i ] * x ; v [ i ] = res % 10 ; carry = res / 10 ; } while ( carry != 0 ) { v . Add ( carry % 10 ) ; carry /= 10 ; } } static int findSumOfDigits ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) multiply ( i ) ; int sum = 0 ; int size = v . Count ; for ( int i = 0 ; i < size ; i ++ ) sum += ( int ) v [ i ] ; return sum ; } static void Main ( ) { int n = 1000 ; Console . WriteLine ( findSumOfDigits ( n ) ) ; } }

Index/key variables: i
Accumulator variables: carry, i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void printOtherSides ( int n ) { if ( n % 2 != 0 ) { if ( n == 1 ) Console . WriteLine ( " - 1" ) ; else { int b = ( n * n - 1 ) / 2 ; int c = ( n * n + 1 ) / 2 ; Console . Write ( " b ▁ = ▁ " + b + " , ▁ c ▁ = ▁ " + c ) ; } } else { if ( n == 2 ) Console . Write ( " - 1" ) ; else { int b = n * n / 4 - 1 ; int c = n * n / 4 + 1 ; Console . Write ( " b ▁ = ▁ " + b + " , ▁ c ▁ = ▁ " + c ) ; } } } public static void Main ( ) { int a = 3 ; printOtherSides ( a ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int makeOdd ( int n ) { if ( n % 2 != 0 ) return 1 ; int i ; for ( i = 2 ; i <= n ; i ++ ) if ( ( n % i == 0 ) && ( ( n / i ) % 2 == 1 ) ) break ; return i ; } public static void Main ( ) { int n = 36 ; int res = makeOdd ( n ) ; Console . Write ( res ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int getTotalXorOfSubarrayXors ( int [ ] arr , int N ) { if ( N % 2 == 0 ) return 0 ; int res = 0 ; for ( int i = 0 ; i < N ; i += 2 ) res ^= arr [ i ] ; return res ; } static void Main ( ) { int [ ] arr = { 3 , 5 , 2 , 4 , 6 } ; int N = arr . Length ; Console . Write ( getTotalXorOfSubarrayXors ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: i, res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class Test { static int countIterations ( int [ ] arr , int n ) { bool oneFound = false ; int res = 0 ; for ( int i = 0 ; i < n ; ) { if ( arr [ i ] == 1 ) oneFound = true ; while ( i < n && arr [ i ] == 1 ) i ++ ; int count_zero = 0 ; while ( i < n && arr [ i ] == 0 ) { count_zero ++ ; i ++ ; } if ( oneFound == false && i == n ) return - 1 ; int curr_count ; if ( i < n && oneFound == true ) { if ( ( count_zero & 1 ) == 0 ) curr_count = count_zero / 2 ; else curr_count = ( count_zero + 1 ) / 2 ; count_zero = 0 ; } else { curr_count = count_zero ; count_zero = 0 ; } res = Math . Max ( res , curr_count ) ; } return res ; } public static void Main ( ) { int [ ] arr = { 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 } ; Console . Write ( countIterations ( arr , arr . Length ) ) ; } }

Index/key variables: i
Accumulator variables: count_zero, i
Iterator variables: i
Boolean variables: oneFound
Class/struct names: Test
C# program:
using System ; class GFG { static int MAX = 100 ; static void Main ( ) { long [ ] arr = new long [ MAX ] ; arr [ 0 ] = 0 ; arr [ 1 ] = 1 ; for ( int i = 2 ; i < MAX ; i ++ ) arr [ i ] = arr [ i - 1 ] + arr [ i - 2 ] ; Console . Write ( " Fibonacci ▁ numbers ▁ divisible ▁ by ▁ " + " their ▁ indexes ▁ are ▁ : STRNEWLINE " ) ; for ( int i = 1 ; i < MAX ; i ++ ) if ( arr [ i ] % i == 0 ) System . Console . Write ( i + " ▁ " ) ; } }

Index/key variables: MAX, i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GfG { static void printConsecutive ( int last , int first ) { Console . Write ( first ++ ) ; for ( int x = first ; x <= last ; x ++ ) Console . Write ( " ▁ + ▁ " + x ) ; } static void findConsecutive ( int N ) { for ( int last = 1 ; last < N ; last ++ ) { for ( int first = 0 ; first < last ; first ++ ) { if ( 2 * N == ( last - first ) * ( last + first + 1 ) ) { Console . Write ( N + " ▁ = ▁ " ) ; printConsecutive ( last , first + 1 ) ; return ; } } } Console . Write ( " - 1" ) ; } public static void Main ( ) { int n = 12 ; findConsecutive ( n ) ; } }

Accumulator variables: first, last, x
Iterator variables: first, last, x
Class/struct names: GfG
C# program:
using System ; class GFG { static int printNthElement ( int n ) { int [ ] arr = new int [ n + 1 ] ; arr [ 1 ] = 4 ; arr [ 2 ] = 7 ; for ( int i = 3 ; i <= n ; i ++ ) { if ( i % 2 != 0 ) arr [ i ] = arr [ i / 2 ] * 10 + 4 ; else arr [ i ] = arr [ ( i / 2 ) - 1 ] * 10 + 7 ; } return arr [ n ] ; } public static void Main ( ) { int n = 6 ; Console . Write ( printNthElement ( n ) ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class MaxSum { static int maxSumLCM ( int n ) { int max_sum = 0 ; for ( int i = 1 ; i * i <= n ; i ++ ) { if ( n % i == 0 ) { max_sum += i ; if ( n / i != i ) max_sum += ( n / i ) ; } } return max_sum ; } public static void Main ( String [ ] args ) { int n = 2 ; Console . Write ( maxSumLCM ( n ) ) ; } }

Accumulator variables: i, max_sum
Iterator variables: i
Class/struct names: MaxSum
C# program:
using System ; class GFG { public static void Main ( ) { double n = 12 ; Console . Write ( Math . Sqrt ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static int findMaxValue ( ) { int res = 2 ; long fact = 2 ; while ( true ) { if ( fact < 0 ) break ; res ++ ; fact = fact * res ; } return res - 1 ; } public static void Main ( ) { Console . Write ( " Maximum ▁ value ▁ of " + " ▁ integer ▁ " + findMaxValue ( ) ) ; } }

Accumulator variables: res
Class/struct names: GFG
C# program:
using System ; class GFG { static bool func ( int [ ] a , int k ) { for ( int i = 0 ; i < a . Length ; i ++ ) if ( a [ i ] % k == 0 ) return true ; return false ; } public static void Main ( ) { int [ ] a = { 14 , 27 , 38 , 76 , 84 } ; int k = 19 ; bool res = func ( a , k ) ; Console . Write ( res ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static String tidyNum ( String str1 , int len ) { char [ ] str = str1 . ToCharArray ( ) ; for ( int i = len - 2 ; i >= 0 ; i -- ) { if ( str [ i ] > str [ i + 1 ] ) { str [ i ] -- ; for ( int j = i + 1 ; j < len ; j ++ ) str [ j ] = '9' ; } } string s = new string ( str ) ; return s ; } static void Main ( ) { String str = "11333445538" ; int len = str . Length ; Console . WriteLine ( tidyNum ( str , len ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GfG { static int findCount ( int m , int n ) { int num1 = 0 ; for ( int i = 0 ; i < m ; i ++ ) num1 = ( num1 * 10 ) + 9 ; int num2 = 0 ; for ( int i = 0 ; i < ( m - 1 ) ; i ++ ) num2 = ( num2 * 10 ) + 9 ; return ( ( num1 / n ) - ( num2 / n ) ) ; } public static void Main ( ) { int m = 2 , n = 6 ; Console . Write ( findCount ( m , n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; class GFG { static int findNthEvenDigitNumber ( int n ) { int count = 0 ; for ( int i = 0 ; ; i ++ ) { int curr = i ; bool isCurrEvenDigit = true ; while ( curr != 0 ) { if ( curr % 10 == 1 curr % 10 == 3 curr % 10 == 5 curr % 10 == 7 curr % 10 == 9 ) isCurrEvenDigit = false ; curr = curr / 10 ; } if ( isCurrEvenDigit == true ) count ++ ; if ( count == n ) return i ; } } public static void Main ( ) { Console . WriteLine ( findNthEvenDigitNumber ( 2 ) ) ; Console . WriteLine ( findNthEvenDigitNumber ( 10 ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Boolean variables: isCurrEvenDigit
Class/struct names: GFG
C# program:
using System ; using System . Collections ; class GFG { static int findNthEvenDigitNumber ( int n ) { if ( n == 1 ) { return 0 ; } ArrayList v = new ArrayList ( ) ; n = n - 1 ; while ( n > 0 ) { v . Add ( n % 5 ) ; n = n / 5 ; } int result = 0 ; for ( int i = v . Count - 1 ; i >= 0 ; i -- ) { result = result * 10 ; result = result + ( int ) v [ i ] ; } return 2 * result ; } public static void Main ( ) { Console . WriteLine ( findNthEvenDigitNumber ( 2 ) ) ; Console . WriteLine ( findNthEvenDigitNumber ( 10 ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class IsDivisible { static bool isDivisibleBy25 ( String str ) { int n = str . Length ; if ( n == 1 ) return false ; return ( ( str [ n - 1 ] - '0' == 0 && str [ n - 2 ] - '0' == 0 ) || ( ( str [ n - 2 ] - '0' ) * 10 + ( str [ n - 1 ] - '0' ) ) % 25 == 0 ) ; } public static void Main ( ) { String str = "76955" ; if ( isDivisibleBy25 ( str ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Class/struct names: IsDivisible
C# program:
using System ; class GFG { static bool check ( String str ) { int n = str . Length ; if ( n == 0 && n == 1 ) return false ; if ( n == 2 ) return ( ( ( str [ n - 2 ] - '0' ) * 10 + ( str [ n - 1 ] - '0' ) ) % 16 == 0 ) ; if ( n == 3 ) return ( ( ( str [ n - 3 ] - '0' ) * 100 + ( str [ n - 2 ] - '0' ) * 10 + ( str [ n - 1 ] - '0' ) ) % 16 == 0 ) ; int last = str [ n - 1 ] - '0' ; int second_last = str [ n - 2 ] - '0' ; int third_last = str [ n - 3 ] - '0' ; int fourth_last = str [ n - 4 ] - '0' ; return ( ( fourth_last * 1000 + third_last * 100 + second_last * 10 + last ) % 16 == 0 ) ; } public static void Main ( ) { String str = "769528" ; if ( check ( str ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No ▁ " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int findIndex ( int n ) { if ( n <= 1 ) return n ; int a = 0 , b = 1 , c = 1 ; int res = 1 ; while ( c < n ) { c = a + b ; res ++ ; a = b ; b = c ; } return res ; } public static void Main ( ) { int result = findIndex ( 21 ) ; Console . WriteLine ( result ) ; } }

Accumulator variables: res
Class/struct names: GFG
C# program:
using System ; class GFG { static int m2 , d2 ; static bool isLeap ( int y ) { if ( y % 100 != 0 && y % 4 == 0 y % 400 == 0 ) return true ; return false ; } static int offsetDays ( int d , int m , int y ) { int offset = d ; if ( m - 1 == 11 ) offset += 335 ; if ( m - 1 == 10 ) offset += 304 ; if ( m - 1 == 9 ) offset += 273 ; if ( m - 1 == 8 ) offset += 243 ; if ( m - 1 == 7 ) offset += 212 ; if ( m - 1 == 6 ) offset += 181 ; if ( m - 1 == 5 ) offset += 151 ; if ( m - 1 == 4 ) offset += 120 ; if ( m - 1 == 3 ) offset += 90 ; if ( m - 1 == 2 ) offset += 59 ; if ( m - 1 == 1 ) offset += 31 ; if ( isLeap ( y ) && m > 2 ) offset += 1 ; return offset ; } static void revoffsetDays ( int offset , int y ) { int [ ] month = { 0 , 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 } ; if ( isLeap ( y ) ) month [ 2 ] = 29 ; int i ; for ( i = 1 ; i <= 12 ; i ++ ) { if ( offset <= month [ i ] ) break ; offset = offset - month [ i ] ; } d2 = offset ; m2 = i ; } static void addDays ( int d1 , int m1 , int y1 , int x ) { int offset1 = offsetDays ( d1 , m1 , y1 ) ; int remDays = isLeap ( y1 ) ? ( 366 - offset1 ) : ( 365 - offset1 ) ; int y2 , offset2 = 0 ; if ( x <= remDays ) { y2 = y1 ; offset2 = offset1 + x ; } else { x -= remDays ; y2 = y1 + 1 ; int y2days = isLeap ( y2 ) ? 366 : 365 ; while ( x >= y2days ) { x -= y2days ; y2 ++ ; y2days = isLeap ( y2 ) ? 366 : 365 ; } offset2 = x ; } revoffsetDays ( offset2 , y2 ) ; Console . WriteLine ( " d2 ▁ = ▁ " + d2 + " , ▁ m2 ▁ = ▁ " + m2 + " , ▁ y2 ▁ = ▁ " + y2 ) ; } static void Main ( ) { int d = 14 , m = 3 , y = 2015 ; int x = 366 ; addDays ( d , m , y , x ) ; } }

Index/key variables: i
Accumulator variables: i, offset, x, y2
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int divisorSum ( int N , int K ) { int sum = 0 ; for ( int i = 2 ; i <= Math . Ceiling ( Math . Sqrt ( N ) ) ; i ++ ) if ( N % i == 0 ) sum += ( i + N / i ) ; return sum ; } static bool isPrime ( int n ) { if ( n == 1 n == 0 ) return false ; if ( n <= 3 ) return true ; if ( n % 2 == 0 n % 3 == 0 ) return false ; for ( int i = 5 ; i * i <= n ; i = i + 6 ) if ( n % i == 0 || n % ( i + 2 ) == 0 ) return false ; return true ; } static bool isHyperPerfect ( int N , int K ) { int sum = divisorSum ( N , K ) ; if ( ( 1 + K * ( sum ) ) == N ) return true ; else return false ; } static public void Main ( ) { int N1 = 1570153 , K1 = 12 ; int N2 = 321 , K2 = 3 ; if ( isHyperPerfect ( N1 , K1 ) ) Console . WriteLine ( N1 + " ▁ is ▁ " + K1 + " - HyperPerfect " ) ; else Console . WriteLine ( N1 + " ▁ is ▁ not ▁ " + K1 + " - HyperPerfect " ) ; if ( isHyperPerfect ( N2 , K2 ) ) Console . WriteLine ( N2 + " ▁ is ▁ " + K2 + " - HyperPerfect " ) ; else Console . WriteLine ( N2 + " ▁ is ▁ not ▁ " + K2 + " - HyperPerfect " ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static long firstkdigits ( int n , int k ) { double product = n * Math . Log10 ( n ) ; double decimal_part = product - Math . Floor ( product ) ; decimal_part = Math . Pow ( 10 , decimal_part ) ; double digits = Math . Pow ( 10 , k - 1 ) ; return ( ( long ) ( decimal_part * digits ) ) ; } public static void Main ( ) { int n = 1450 ; int k = 6 ; Console . Write ( firstkdigits ( n , k ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void printWellOrdered ( int number , int x , int k ) { if ( k == 0 ) { Console . Write ( number + " ▁ " ) ; return ; } for ( int i = ( x + 1 ) ; i < 10 ; i ++ ) printWellOrdered ( number * 10 + i , i , k - 1 ) ; } static void generateWellOrdered ( int k ) { printWellOrdered ( 0 , 0 , k ) ; } public static void Main ( ) { int k = 3 ; generateWellOrdered ( k ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static long moduloMultiplication ( long a , long b , long mod ) { a %= mod ; while ( b > 0 ) { if ( ( b & 1 ) > 0 ) res = ( res + a ) % mod ; a = ( 2 * a ) % mod ; } return res ; } static void Main ( ) { long a = 10123465234878998 ; long b = 65746311545646431 ; long m = 10005412336548794 ; Console . WriteLine ( moduloMultiplication ( a , b , m ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int numberOf2sinRange ( int n ) { string s = " " ; for ( int i = 0 ; i < n + 1 ; i ++ ) s += i + " " ; int count = 0 ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( s [ i ] == '2' ) { count ++ ; } } return count ; } public static void Main ( string [ ] args ) { int n = 30 ; Console . Write ( numberOf2sinRange ( n ) ) ; } }

Index/key variables: i
Accumulator variables: count, i, s
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int count2sinRangeAtDigit ( int number , int d ) { int powerOf10 = ( int ) Math . Pow ( 10 , d ) ; int nextPowerOf10 = powerOf10 * 10 ; int right = number % powerOf10 ; int roundDown = number - number % nextPowerOf10 ; int roundup = roundDown + nextPowerOf10 ; int digit = ( number / powerOf10 ) % 10 ; if ( digit < 2 ) { return roundDown / 10 ; } if ( digit == 2 ) { return roundDown / 10 + right + 1 ; } return roundup / 10 ; } static int numberOf2sinRange ( int number ) { string convert ; convert = number . ToString ( ) ; string s = convert ; int len = s . Length ; int count = 0 ; for ( int digit = 0 ; digit < len ; digit ++ ) { count += count2sinRangeAtDigit ( number , digit ) ; } return count ; } public static void Main ( ) { Console . WriteLine ( numberOf2sinRange ( 22 ) ) ; Console . WriteLine ( numberOf2sinRange ( 100 ) ) ; } }

Accumulator variables: count, digit
Iterator variables: digit
Class/struct names: GFG
C# program:
static long factorial ( int n ) { const long M = 1000000007 ; long f = 1 ; for ( int i = 1 ; i <= n ; i ++ ) return f % M ; }

Accumulator variables: i
Iterator variables: i
C# program:
static long factorial ( int n ) { long M = 1000000007 ; long f = 1 ; for ( int i = 1 ; i <= n ; i ++ ) return f ; }

Accumulator variables: i
Iterator variables: i
C# program:
using System ; class IsDivisible { static bool isDivisibleBy5 ( String str ) { int n = str . Length ; return ( ( ( str [ n - 1 ] - '0' ) == 0 ) || ( ( str [ n - 1 ] - '0' ) == 5 ) ) ; } public static void Main ( ) { String str = "76955" ; if ( isDivisibleBy5 ( str ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Class/struct names: IsDivisible