dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static bool isDvisibleBy12 ( string num ) { if ( num . Length >= 3 ) { int d1 = ( int ) num [ num . Length - 1 ] ; if ( d1 % 2 != 0 ) return false ; int d2 = ( int ) num [ num . Length - 2 ] ; int sum = 0 ; for ( int i = 0 ; i < num . Length ; i ++ ) sum += num [ i ] ; return ( sum % 3 == 0 && ( d2 * 10 + d1 ) % 4 == 0 ) ; } else { int number = int . Parse ( num ) ; return ( number % 12 == 0 ) ; } } public static void Main ( ) { String num = "12244824607284961224" ; if ( isDvisibleBy12 ( num ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GfG { static bool check ( int n ) { int d = ( int ) Math . Sqrt ( n ) ; if ( d * d == n ) return true ; return false ; } static int largestNonPerfectSquareNumber ( int [ ] a , int n ) { int maxi = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ! check ( a [ i ] ) ) maxi = Math . Max ( a [ i ] , maxi ) ; } return maxi ; } public static void Main ( ) { int [ ] a = { 16 , 20 , 25 , 2 , 3 , 10 } ; int n = a . Length ; Console . WriteLine ( largestNonPerfectSquareNumber ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; class GFG { static void printAP ( int a , int d , int n ) { int curr_term ; curr_term = a ; for ( int i = 1 ; i <= n ; i ++ ) { Console . Write ( curr_term + " ▁ " ) ; curr_term += d ; } } public static void Main ( ) { int a = 2 ; int d = 1 ; int n = 5 ; printAP ( a , d , n ) ; } }

Accumulator variables: curr_term, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void printNonSquare ( int n ) { int curr_count = 2 , num = 2 , count = 0 ; while ( count < n ) { for ( int i = 0 ; i < curr_count && count < n ; i ++ ) { Console . Write ( num + " ▁ " ) ; count ++ ; num ++ ; } num ++ ; curr_count += 2 ; } } static public void Main ( ) { int n = 10 ; printNonSquare ( n ) ; } }

Accumulator variables: count, curr_count, i, num
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GfG { public static int countZeroso ( int [ ] a , int n ) { int count2 = 0 , count5 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { while ( a [ i ] % 2 == 0 ) { a [ i ] = a [ i ] / 2 ; count2 ++ ; } while ( a [ i ] % 5 == 0 ) { a [ i ] = a [ i ] / 5 ; count5 ++ ; } } return ( count2 < count5 ) ? count2 : count5 ; } public static void Main ( ) { int [ ] a = new int [ ] { 10 , 100 , 20 , 30 , 50 , 91 , 12 , 80 } ; int n = 8 ; Console . WriteLine ( countZeroso ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: count2, count5, i
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; class GFG { static int squareSum ( int n ) { return 2 * n * ( n + 1 ) * ( 2 * n + 1 ) / 3 ; } public static void Main ( ) { Console . Write ( squareSum ( 8 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static long [ ] pwr ; static bool isMunchhausen ( int n ) { long sum = 0 ; int temp = n ; while ( temp > 0 ) { int index = temp % 10 ; sum = sum + pwr [ index ] ; temp /= 10 ; } return ( sum == n ) ; } static void printMunchhausenNumbers ( int n ) { pwr = new long [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) pwr [ i ] = ( long ) Math . Pow ( ( float ) i , ( float ) i ) ; for ( int i = 1 ; i <= n ; i ++ ) if ( isMunchhausen ( i ) == true ) Console . WriteLine ( i ) ; } public static void Main ( ) { int n = 10000 ; printMunchhausenNumbers ( n ) ; } }

Index/key variables: i, index
Accumulator variables: i, temp
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GfG { public static int kthdigit ( int a , int b , int k ) { int p = ( int ) Math . Pow ( a , b ) ; int count = 0 ; while ( p > 0 && count < k ) { int rem = p % 10 ; count ++ ; if ( count == k ) return rem ; p = p / 10 ; } return 0 ; } public static void Main ( ) { int a = 5 , b = 2 ; int k = 1 ; Console . WriteLine ( kthdigit ( a , b , k ) ) ; } }

Accumulator variables: count
Class/struct names: GfG
C# program:
using System ; class GFG { static long digSum ( long n ) { if ( n == 0 ) return 0 ; return ( n % 9 == 0 ) ? 9 : ( n % 9 ) ; } static long PowDigSum ( long n , long x ) { long sum = digSum ( n ) ; long rem = x % 6 ; if ( ( sum == 3 sum == 6 ) && x > 1 ) return 9 ; else if ( x == 1 ) return sum ; else if ( x == 0 ) return 1 ; else if ( rem == 0 ) return digSum ( ( long ) Math . Pow ( sum , 6 ) ) ; else return digSum ( ( long ) Math . Pow ( sum , rem ) ) ; } public static void Main ( ) { int n = 33333 ; int x = 332654 ; Console . WriteLine ( PowDigSum ( n , x ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class Area { public static int maxArea ( int [ ] A , int len ) { int l = 0 ; int r = len - 1 ; int area = 0 ; while ( l < r ) { area = Math . Max ( area , Math . Min ( A [ l ] , A [ r ] ) * ( r - l ) ) ; if ( A [ l ] < A [ r ] ) l += 1 ; else r -= 1 ; } return area ; } public static void Main ( ) { int [ ] a = { 1 , 5 , 4 , 3 } ; int [ ] b = { 3 , 1 , 2 , 4 , 5 } ; int len1 = 4 ; Console . WriteLine ( maxArea ( a , len1 ) ) ; int len2 = 5 ; Console . WriteLine ( maxArea ( b , len2 ) ) ; } }

Index/key variables: l, r
Accumulator variables: l, r
Class/struct names: Area
C# program:
using System ; class GFG { static int mobius ( int n ) { int p = 0 ; if ( n % 2 == 0 ) { n = n / 2 ; p ++ ; if ( n % 2 == 0 ) return 0 ; } for ( int i = 3 ; i <= Math . Sqrt ( n ) ; i = i + 2 ) { if ( n % i == 0 ) { n = n / i ; p ++ ; if ( n % i == 0 ) return 0 ; } } return ( p % 2 == 0 ) ? - 1 : 1 ; } public static void Main ( ) { int N = 17 ; Console . WriteLine ( " Mobius ▁ Functions " + " ▁ M ( N ) ▁ at ▁ N ▁ = ▁ " + N + " ▁ is : ▁ " + mobius ( N ) ) ; Console . WriteLine ( " Mobius ▁ Functions " + " M ( N ) ▁ at ▁ N ▁ = ▁ " + 25 + " ▁ is : ▁ " + mobius ( 25 ) ) ; Console . WriteLine ( " Mobius ▁ Functions " + " M ( N ) ▁ at ▁ N ▁ = ▁ " + 6 + " ▁ is : ▁ " + mobius ( 6 ) ) ; } }

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

Accumulator variables: i, res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static double PHI = 1.6180339 ; static int [ ] f = { 0 , 1 , 1 , 2 , 3 , 5 } ; static int fib ( int n ) { if ( n < 6 ) return f [ n ] ; int t = 5 ; int fn = 5 ; while ( t < n ) { fn = ( int ) Math . Round ( fn * PHI ) ; t ++ ; } return fn ; } public static void Main ( ) { int n = 9 ; Console . WriteLine ( n + " th ▁ Fibonacci " + " ▁ Number ▁ = ▁ " + fib ( n ) ) ; } }

Index/key variables: n
Accumulator variables: t
Class/struct names: GFG
C# program:
using System ; class GFG { static float func ( float x , float y ) { return ( x + y + x * y ) ; } static void euler ( float x0 , float y , float h , float x ) { while ( x0 < x ) { y = y + h * func ( x0 , y ) ; x0 = x0 + h ; } Console . WriteLine ( " Approximate ▁ solution ▁ at ▁ x ▁ = ▁ " + x + " ▁ is ▁ " + y ) ; } public static void Main ( ) { float x0 = 0 ; float y0 = 1 ; float h = 0.025f ; float x = 0.1f ; euler ( x0 , y0 , h , x ) ; } }

Class/struct names: GFG
C# program:
using System ; class GfG { static void solution ( int a , int b , int n ) { for ( int i = 0 ; i * a <= n ; i ++ ) { if ( ( n - ( i * a ) ) % b == 0 ) { Console . Write ( " x ▁ = ▁ " + i + " , ▁ y ▁ = ▁ " + ( n - ( i * a ) ) / b ) ; return ; } } Console . Write ( " No ▁ solution " ) ; } public static void Main ( ) { int a = 2 , b = 3 , n = 7 ; solution ( a , b , n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; class GFG { static int binomialCoeffSum ( int n ) { return ( 1 << n ) ; } static public void Main ( ) { int n = 4 ; Console . WriteLine ( binomialCoeffSum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class Eulerian { public static void precisionCompute ( int x , int y , int n ) { if ( y == 0 ) { Console . WriteLine ( " Infinite " ) ; return ; } if ( x == 0 ) { Console . WriteLine ( "0" ) ; return ; } if ( n <= 0 ) { Console . WriteLine ( x / y ) ; return ; } if ( ( ( x > 0 ) && ( y < 0 ) ) || ( ( x < 0 ) && ( y > 0 ) ) ) { Console . WriteLine ( " - " ) ; x = x > 0 ? x : - x ; y = y > 0 ? y : - y ; } int d = x / y ; for ( int i = 0 ; i <= n ; i ++ ) { Console . Write ( d ) ; x = x - ( y * d ) ; if ( x == 0 ) break ; x = x * 10 ; d = x / y ; if ( i == 0 ) Console . Write ( " . " ) ; } } public static void Main ( ) { int x = 22 , y = 7 , n = 15 ; precisionCompute ( x , y , n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: Eulerian
C# program:
using System ; class GFG { static void quadrant ( int x , int y ) { if ( x > 0 && y > 0 ) Console . WriteLine ( " lies ▁ in ▁ First ▁ quadrant " ) ; else if ( x < 0 && y > 0 ) Console . WriteLine ( " lies ▁ in ▁ Second ▁ quadrant " ) ; else if ( x < 0 && y < 0 ) Console . WriteLine ( " lies ▁ in ▁ Third ▁ quadrant " ) ; else if ( x > 0 && y < 0 ) Console . WriteLine ( " lies ▁ in ▁ Fourth ▁ quadrant " ) ; else if ( x == 0 && y > 0 ) Console . WriteLine ( " lies ▁ at ▁ positive ▁ y ▁ axis " ) ; else if ( x == 0 && y < 0 ) Console . WriteLine ( " lies ▁ at ▁ negative ▁ y ▁ axis " ) ; else if ( y == 0 && x < 0 ) Console . WriteLine ( " lies ▁ at ▁ negative ▁ x ▁ axis " ) ; else if ( y == 0 && x > 0 ) Console . WriteLine ( " lies ▁ at ▁ positive ▁ x ▁ axis " ) ; else Console . WriteLine ( " lies ▁ at ▁ origin " ) ; } public static void Main ( ) { int x = 1 , y = 1 ; quadrant ( x , y ) ; } }

Class/struct names: GFG
C# program:
using System ; class Prime { public static bool checkDigits ( int n ) { while ( n > 0 ) { int dig = n % 10 ; if ( dig != 2 && dig != 3 && dig != 5 && dig != 7 ) return false ; n /= 10 ; } return true ; } public static bool prime ( int n ) { if ( n == 1 ) return false ; for ( int i = 2 ; i * i <= n ; i ++ ) { if ( n % i == 0 ) return false ; } return true ; } public static bool isFullPrime ( int n ) { return ( checkDigits ( n ) && prime ( n ) ) ; } public static void Main ( ) { int n = 53 ; if ( isFullPrime ( n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: i, n
Iterator variables: i
Class/struct names: Prime
C# program:
using System ; class GFG { static string getResult ( string st ) { int sum = 0 ; int length = st . Length ; for ( int i = 0 ; i < length ; i ++ ) { sum = sum + ( int ) Math . Pow ( st [ i ] - '0' , length ) ; } int number = int . Parse ( st ) ; if ( number == sum ) return " yes " ; else return " no " ; } public static void Main ( string [ ] args ) { string st = "153" ; Console . Write ( getResult ( st ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 500 ; static int nthSHN ( int n , int [ ] dp ) { if ( n == 1 n == 2 ) return dp [ n ] = 1 ; if ( dp [ n ] != - 1 ) return dp [ n ] ; return dp [ n ] = ( ( 6 * n - 9 ) * nthSHN ( n - 1 , dp ) - ( n - 3 ) * nthSHN ( n - 2 , dp ) ) / n ; } public static void Main ( ) { int n = 6 ; int [ ] dp = new int [ MAX ] ; for ( int i = 0 ; i < dp . Length ; i ++ ) dp [ i ] = - 1 ; Console . Write ( nthSHN ( n , dp ) ) ; } }

Index/key variables: MAX, i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GfG { static int evenSum ( int n ) { int curr = 2 , sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { sum += curr ; curr += 2 ; } return sum ; } public static void Main ( ) { int n = 20 ; Console . WriteLine ( " Sum ▁ of ▁ first ▁ " + n + " ▁ Even ▁ numbers ▁ is : ▁ " + evenSum ( n ) ) ; } }

Accumulator variables: curr, i, sum
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; public class GfG { static int evenSum ( int n ) { return ( n * ( n + 1 ) ) ; } public static void Main ( ) { int n = 20 ; Console . WriteLine ( " Sum ▁ of ▁ first ▁ " + n + " ▁ Even ▁ numbers ▁ is : ▁ " + evenSum ( n ) ) ; } }

Class/struct names: GfG
C# program:
using System ; class GFG { static double kmphTOmph ( double kmph ) { return 0.6214 * kmph ; } static double mphTOkmph ( double mph ) { return mph * 1.60934 ; } public static void Main ( ) { double kmph = 150 ; double mph = 100 ; Console . WriteLine ( " speed ▁ in ▁ miles / hr ▁ is ▁ " + kmphTOmph ( kmph ) ) ; Console . WriteLine ( " speed ▁ in ▁ km / hr ▁ is ▁ " + mphTOkmph ( mph ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static long subsequences ( int [ ] a , int n , int r ) { Dictionary < int , int > left = new Dictionary < int , int > ( ) , right = new Dictionary < int , int > ( ) ; long ans = - 1 ; for ( int i = 0 ; i < n ; i ++ ) if ( right . ContainsKey ( a [ i ] ) ) right [ a [ i ] ] = right [ a [ i ] ] + 1 ; else right . Add ( a [ i ] , 1 ) ; for ( int i = 0 ; i < n ; i ++ ) { long c1 = 0 , c2 = 0 ; if ( a [ i ] % r == 0 ) if ( left . ContainsKey ( a [ i ] / r ) ) c1 = right [ a [ i ] / r ] ; else c1 = 0 ; if ( right . ContainsKey ( a [ i ] ) ) right [ a [ i ] ] = right [ a [ i ] ] ; else right . Add ( a [ i ] , - 1 ) ; if ( right . ContainsKey ( a [ i ] * r ) ) c2 = right [ a [ i ] * r ] ; else c2 = 0 ; ans += ( c1 * c2 ) ; if ( left . ContainsKey ( a [ i ] ) ) left [ a [ i ] ] = 0 ; else left . Add ( a [ i ] , 1 ) ; } return ans - 1 ; } public static void Main ( String [ ] args ) { int [ ] a = { 1 , 2 , 6 , 2 , 3 , 6 , 9 , 18 , 3 , 9 } ; int n = a . Length ; int r = 3 ; Console . WriteLine ( subsequences ( a , n , r ) ) ; } }

Index/key variables: i
Accumulator variables: ans, i
Iterator variables: i
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 int findNumber ( int [ ] arr , int n ) { int ans = arr [ 0 ] ; for ( int i = 0 ; i < n ; i ++ ) ans = gcd ( ans , arr [ i ] ) ; for ( int i = 0 ; i < n ; i ++ ) if ( arr [ i ] == ans ) return ans ; return - 1 ; } public static void Main ( ) { int [ ] arr = { 2 , 2 , 4 } ; int n = arr . Length ; Console . WriteLine ( findNumber ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections ; class GFG { static ArrayList primes = new ArrayList ( ) ; static void SieveofEratosthenes ( int n ) { bool [ ] visited = new bool [ n * n + 2 ] ; for ( int i = 2 ; i <= n + 1 ; i ++ ) if ( ! visited [ i ] ) { for ( int j = i * i ; j <= n + 1 ; j += i ) visited [ j ] = true ; primes . Add ( i ) ; } } static bool specialPrimeNumbers ( int n , int k ) { SieveofEratosthenes ( n ) ; int count = 0 ; for ( int i = 0 ; i < primes . Count ; i ++ ) { for ( int j = 0 ; j < i - 1 ; j ++ ) { if ( ( int ) primes [ j ] + ( int ) primes [ j + 1 ] + 1 == ( int ) primes [ i ] ) { count ++ ; break ; } } if ( count == k ) return true ; } return false ; } public static void Main ( ) { int n = 27 , k = 2 ; if ( specialPrimeNumbers ( n , k ) ) Console . WriteLine ( " YES " ) ; else Console . WriteLine ( " NO " ) ; } }

Index/key variables: i, j
Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static void factorize ( long n ) { int count = 0 ; while ( ! ( n % 2 > 0 ) ) { n >>= 1 ; count ++ ; } if ( count > 0 ) Console . WriteLine ( "2" + " ▁ " + count ) ; for ( long i = 3 ; i <= ( long ) Math . Sqrt ( n ) ; i += 2 ) { count = 0 ; while ( n % i == 0 ) { count ++ ; n = n / i ; } if ( count > 0 ) Console . WriteLine ( i + " ▁ " + count ) ; } if ( n > 2 ) Console . WriteLine ( n + " ▁ " + "1" ) ; } static public void Main ( ) { long n = 1000000000000000000 ; factorize ( n ) ; } }

Accumulator variables: count, i
Iterator variables: i
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 int minimumMoves ( int [ ] A , int N ) { int one = 0 ; for ( int i = 0 ; i < N ; i ++ ) if ( A [ i ] == 1 ) one ++ ; if ( one != 0 ) return N - one ; int minimum = int . MaxValue ; for ( int i = 0 ; i < N ; i ++ ) { int g = A [ i ] ; for ( int j = i + 1 ; j < N ; j ++ ) { g = __gcd ( A [ j ] , g ) ; if ( g == 1 ) { minimum = Math . Min ( minimum , j - i ) ; break ; } } } if ( minimum == int . MaxValue ) return - 1 ; else return N + minimum - 1 ; } public static void Main ( ) { int [ ] A = { 2 , 4 , 3 , 9 } ; int N = A . Length ; Console . WriteLine ( minimumMoves ( A , N ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, one
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GfG { public static void series ( int n , int d ) { if ( d == 0 ) { for ( int i = 0 ; i < n ; i ++ ) Console . Write ( "0" ) ; Console . WriteLine ( ) ; return ; } if ( n % 2 == 0 ) { for ( int i = 1 ; i <= n ; i ++ ) { Console . Write ( Math . Pow ( - 1 , i ) * d + " ▁ " ) ; } Console . WriteLine ( ) ; } else { float m = n ; float r = ( m / ( m - 1 ) ) ; float g = ( float ) ( d * ( float ) ( Math . Sqrt ( r ) ) ) ; Console . Write ( "0 ▁ " ) ; for ( int i = 1 ; i < n ; i ++ ) { Console . Write ( Math . Pow ( - 1 , i ) * g + " ▁ " ) ; } Console . WriteLine ( ) ; } } public static void Main ( ) { int n = 3 , d = 3 ; series ( n , d ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; class GFG { static int countDigitOne ( int n ) { int countr = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { string str = i . ToString ( ) ; countr += str . Split ( "1" ) . Length - 1 ; } return countr ; } public static void Main ( ) { int n = 13 ; Console . WriteLine ( countDigitOne ( n ) ) ; n = 131 ; Console . WriteLine ( countDigitOne ( n ) ) ; n = 159 ; Console . WriteLine ( countDigitOne ( n ) ) ; } }

Accumulator variables: countr, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static long N = 1000000007L ; static long exponentiation ( long bas , long exp ) { long t = 1L ; while ( exp > 0 ) { if ( exp % 2 != 0 ) t = ( t * bas ) % N ; bas = ( bas * bas ) % N ; exp /= 2 ; } return t % N ; } public static void Main ( ) { long bas = 5 ; long exp = 100000 ; long modulo = exponentiation ( bas , exp ) ; Console . WriteLine ( modulo ) ; } }

Accumulator variables: exp
Class/struct names: GFG
C# program:
using System ; public class GFG { static int factorial ( int x ) { if ( x <= 1 ) return 1 ; int res = 2 ; for ( int i = 3 ; i <= x ; i ++ ) res = res * i ; return res ; } static int gcdOfFactorial ( int m , int n ) { int min = m < n ? m : n ; return factorial ( min ) ; } public static void Main ( ) { int m = 5 , n = 9 ; Console . WriteLine ( gcdOfFactorial ( m , n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int recDigSum ( int n ) { if ( n == 0 ) return 0 ; else { if ( n % 9 == 0 ) return 9 ; else return n % 9 ; } } static void check ( int n ) { n = recDigSum ( n ) ; if ( n == 2 n == 3 n == 5 n == 7 ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } public static void Main ( ) { int n = 5602 ; check ( n ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int findNumber ( int n ) { int x = ( int ) Math . Floor ( ( - 1 + Math . Sqrt ( 1 + 8 * n - 8 ) ) / 2 ) ; int Base = ( x * ( x + 1 ) ) / 2 + 1 ; return n - Base + 1 ; } public static void Main ( ) { int n = 55 ; Console . WriteLine ( findNumber ( n ) ) ; } }

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

Class/struct names: GFG
C# program:
using System ; class GFG { static void calculate ( int [ ] a , int [ ] b , int n , int m ) { int mul = 1 ; for ( int i = 0 ; i < m ; i ++ ) if ( b [ i ] != 0 ) mul = mul * b [ i ] ; for ( int i = 0 ; i < n ; i ++ ) { int x = ( int ) Math . Floor ( ( double ) ( a [ i ] / mul ) ) ; Console . Write ( x + " ▁ " ) ; } } public static void Main ( ) { int [ ] a = { 5 , 100 , 8 } ; int [ ] b = { 2 , 3 } ; int n = a . Length ; int m = b . Length ; calculate ( a , b , n , m ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { class pair { public int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static int findPowerOfP ( int n , int p ) { int count = 0 ; int r = p ; while ( r <= n ) { count += ( n / r ) ; r = r * p ; } return count ; } static List < pair > primeFactorsofK ( int k ) { List < pair > ans = new List < pair > ( ) ; for ( int i = 2 ; k != 1 ; i ++ ) { if ( k % i == 0 ) { int count = 0 ; while ( k % i == 0 ) { k = k / i ; count ++ ; } ans . Add ( new pair ( i , count ) ) ; } } return ans ; } static int largestPowerOfK ( int n , int k ) { List < pair > vec = new List < pair > ( ) ; vec = primeFactorsofK ( k ) ; int ans = int . MaxValue ; for ( int i = 0 ; i < vec . Count ; i ++ ) ans = Math . Min ( ans , findPowerOfP ( n , vec [ i ] . first ) / vec [ i ] . second ) ; return ans ; } public static void Main ( String [ ] args ) { Console . Write ( largestPowerOfK ( 7 , 2 ) + " STRNEWLINE " ) ; Console . Write ( largestPowerOfK ( 10 , 9 ) + " STRNEWLINE " ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG, pair
C# program:
using System ; class GFG { static void print ( int n ) { Console . WriteLine ( n + n / 2 ) ; for ( int i = 2 ; i <= n ; i += 2 ) Console . Write ( i + " ▁ " ) ; for ( int i = 1 ; i <= n ; i += 2 ) Console . Write ( i + " ▁ " ) ; for ( int i = 2 ; i <= n ; i += 2 ) Console . Write ( i + " ▁ " ) ; } public static void Main ( ) { int n = 3 ; print ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
class GFG { static int lcm_fun ( int a , int b ) { if ( b == 0 ) return a ; return lcm_fun ( b , a % b ) ; } static int digitLCM ( int n ) { int lcm = 1 ; while ( n > 0 ) { lcm = ( n % 10 * lcm ) / lcm_fun ( n % 10 , lcm ) ; if ( lcm == 0 ) return 0 ; n = n / 10 ; } return lcm ; } public static void Main ( ) { int n = 397 ; System . Console . WriteLine ( digitLCM ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double e = 2.71828 ; static int roundNo ( float num ) { return ( int ) ( num < 0 ? num - 0.5 : num + 0.5 ) ; } static void printBestCandidate ( int [ ] candidate , int n ) { int sample_size = roundNo ( ( float ) ( n / e ) ) ; Console . WriteLine ( " STRNEWLINE STRNEWLINE Sample ▁ size ▁ is ▁ " + sample_size ) ; int best = 0 ; for ( int i = 1 ; i < sample_size ; i ++ ) if ( candidate [ i ] > candidate [ best ] ) best = i ; for ( int i = sample_size ; i < n ; i ++ ) if ( candidate [ i ] >= candidate [ best ] ) { best = i ; break ; } if ( best >= sample_size ) Console . WriteLine ( " found is " ( best + 1 ) + " ▁ with ▁ talent ▁ " + candidate [ best ] ) ; else Console . Write ( " Couldn ' t ▁ find ▁ a ▁ best ▁ candidate STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { int n = 8 ; int [ ] candidate = new int [ n ] ; Random rand = new Random ( ) ; for ( int i = 0 ; i < n ; i ++ ) candidate [ i ] = 1 + rand . Next ( 1 , 8 ) ; Console . Write ( " Candidate ▁ : ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) Console . Write ( i + 1 + " ▁ " ) ; Console . WriteLine ( ) ; Console . Write ( " Talents ▁ : ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) Console . Write ( candidate [ i ] + " ▁ " ) ; printBestCandidate ( candidate , n ) ; } }

Index/key variables: best, i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG