dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Collections . Generic ; class Solution { static readonly int MAXN = 100001 ; static int [ ] spf = new int [ MAXN ] ; static void sieve ( ) { spf [ 1 ] = 1 ; for ( int i = 2 ; i < MAXN ; i ++ ) spf [ i ] = i ; for ( int i = 4 ; i < MAXN ; i += 2 ) spf [ i ] = 2 ; for ( int i = 3 ; i * i < MAXN ; i ++ ) { if ( spf [ i ] == i ) { for ( int j = i * i ; j < MAXN ; j += i ) if ( spf [ j ] == j ) spf [ j ] = i ; } } } static List < int > getFactorization ( int x ) { List < int > ret = new List < int > ( ) ; while ( x != 1 ) { int temp = spf [ x ] ; ret . Add ( temp ) ; while ( x % temp == 0 ) x = x / temp ; } return ret ; } static int maxElement ( int [ ] A , int n ) { sieve ( ) ; Dictionary < int , int > m = new Dictionary < int , int > ( ) ; for ( int j = 0 ; j < n ; ++ j ) { List < int > p = getFactorization ( A [ j ] ) ; for ( int i = 0 ; i < p . Count ; i ++ ) if ( m . ContainsKey ( p [ i ] ) ) m [ p [ i ] ] = m [ p [ i ] ] + 1 ; else m . Add ( p [ i ] , 1 ) ; } int cnt = 0 , ans = 10000000 ; foreach ( KeyValuePair < int , int > me in m ) { if ( me . Value >= cnt ) { cnt = me . Value ; if ( ans > me . Key ) ans = me . Key ; else ans = ans ; } } return ans ; } public static void Main ( String [ ] args ) { int [ ] A = { 2 , 5 , 10 } ; int n = A . Length ; Console . Write ( maxElement ( A , n ) ) ; } }

Index/key variables: MAXN, i, j, x
Accumulator variables: i, j
Iterator variables: i, j, me
Class/struct names: Solution
C# program:
using System ; class GFG { static float SellingPrice ( float CP , float PP ) { float P_decimal = 1 + ( PP / 100 ) ; float res = P_decimal * CP ; return res ; } public static void Main ( ) { float C = 720 , P = 13 ; Console . Write ( SellingPrice ( C , P ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Linq ; public class GFG { static int compositeProduct ( int [ ] arr , int n ) { int max_val = arr . Max ( ) ; bool [ ] prime = new bool [ max_val + 1 ] ; for ( int i = 0 ; i < max_val + 1 ; i ++ ) prime [ i ] = true ; prime [ 0 ] = true ; prime [ 1 ] = true ; for ( int p = 2 ; p * p <= max_val ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * 2 ; i <= max_val ; i += p ) { prime [ i ] = false ; } } } int product = 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ! prime [ arr [ i ] ] ) { product *= arr [ i ] ; } } return product ; } public static void Main ( ) { int [ ] arr = { 2 , 3 , 4 , 5 , 6 , 7 } ; int n = arr . Length ; Console . WriteLine ( compositeProduct ( arr , n ) ) ; } }

Index/key variables: i, p
Accumulator variables: i, p, product
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; public class GFG { static int sum_odd ( int n ) { int sum = 0 , pos = 1 ; while ( n > 0 ) { if ( pos % 2 == 1 ) sum += n % 10 ; n = n / 10 ; pos ++ ; } return sum ; } static bool check_prime ( 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 ; } static public void Main ( ) { int n = 223 ; int sum = sum_odd ( n ) ; if ( check_prime ( sum ) ) Console . WriteLine ( " YES " ) ; else Console . WriteLine ( " NO " ) ; } }

Accumulator variables: pos, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static double findAmount ( double X , double W , double Y ) { return ( X * ( Y - W ) ) / ( 100 - Y ) ; } public static void Main ( ) { double X = 100 , W = 50 , Y = 60 ; Console . WriteLine ( " Water ▁ to ▁ be ▁ added ▁ = ▁ { 0 } " , findAmount ( X , W , Y ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int reverseNum ( int x ) { string s = x . ToString ( ) ; string str = " " ; for ( int i = s . Length - 1 ; i >= 0 ; i -- ) { str = str + s [ i ] ; } int rev = Int32 . Parse ( str ) ; return rev ; } static bool isMysteryNumber ( int n ) { for ( int i = 1 ; i <= n / 2 ; i ++ ) { int j = reverseNum ( i ) ; if ( i + j == n ) { Console . WriteLine ( i + " ▁ " + j ) ; return true ; } } Console . WriteLine ( " Not ▁ a ▁ Mystery ▁ Number " ) ; return false ; } public static void Main ( ) { int n = 121 ; isMysteryNumber ( n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void ReplaceElements ( int [ ] arr , int n ) { int prod = 1 ; for ( int i = 0 ; i < n ; ++ i ) { prod *= arr [ i ] ; } for ( int i = 0 ; i < n ; ++ i ) { arr [ i ] = prod / arr [ i ] ; } } static public void Main ( ) { int [ ] arr = { 2 , 3 , 3 , 5 , 7 } ; int n = arr . Length ; ReplaceElements ( arr , n ) ; for ( int i = 0 ; i < n ; ++ i ) { Console . Write ( arr [ i ] + " ▁ " ) ; } Console . WriteLine ( " " ) ; } }

Index/key variables: i
Accumulator variables: prod
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public bool Check_is_possible ( int l , int r , int k ) { int count = 0 ; for ( int i = l ; i <= r ; i ++ ) { if ( i % k == 0 ) count ++ ; } return ( count > 1 ) ; } public static void Main ( ) { GFG g = new GFG ( ) ; int l = 4 , r = 12 ; int k = 5 ; if ( g . Check_is_possible ( l , r , k ) ) Console . WriteLine ( " YES STRNEWLINE " ) ; else Console . WriteLine ( " NO STRNEWLINE " ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GfG { static bool isValid ( long N , int K ) { HashSet < long > m1 = new HashSet < long > ( ) ; HashSet < int > m2 = new HashSet < int > ( ) ; while ( N > 0 ) { m1 . Add ( N % 10 ) ; N /= 10 ; } while ( K > 0 ) { m2 . Add ( K % 10 ) ; K /= 10 ; } if ( m1 . Equals ( m2 ) ) { return true ; } return false ; } static String anyPermutation ( long N , int K ) { int [ ] powK = new int [ 100 + 1 ] ; int Limit = ( int ) Math . Pow ( 10 , 18 ) ; powK [ 0 ] = K ; int i = 1 ; while ( powK [ i - 1 ] * K < Limit && i < 100 ) { powK [ i ] = powK [ i - 1 ] * K ; i ++ ; } for ( int j = 0 ; j < i ; j ++ ) { if ( ! isValid ( N , powK [ j ] ) ) { return " True " ; } } return " False " ; } public static void Main ( String [ ] args ) { long N = 96889010407 ; int K = 7 ; Console . WriteLine ( anyPermutation ( N , K ) ) ; } }

Index/key variables: i, j
Accumulator variables: K, N, i, j
Iterator variables: j
Class/struct names: GfG
C# program:
using System ; class GFG { public static int sum ( int N ) { int S1 , S2 , S3 ; S1 = ( ( N / 2 ) ) * ( 2 * 2 + ( N / 2 - 1 ) * 2 ) / 2 ; S2 = ( ( N / 7 ) ) * ( 2 * 7 + ( N / 7 - 1 ) * 7 ) / 2 ; S3 = ( ( N / 14 ) ) * ( 2 * 14 + ( N / 14 - 1 ) * 14 ) / 2 ; return S1 + S2 - S3 ; } public static int Main ( ) { int N = 20 ; Console . WriteLine ( sum ( N ) ) ; return 0 ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int fastPow ( int N , int K ) { if ( K == 0 ) return 1 ; int temp = fastPow ( N , K / 2 ) ; if ( K % 2 == 0 ) return temp * temp ; else return N * temp * temp ; } static int countWays ( int N , int K ) { return K * fastPow ( K - 1 , N - 1 ) ; } public static void Main ( ) { int N = 3 , K = 3 ; Console . WriteLine ( countWays ( N , K ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int sumNth ( int [ ] A , int [ ] B , int m , int n ) { int res = 0 ; if ( n == 1 ) { for ( int i = 0 ; i < m ; i ++ ) res = res + A [ i ] ; } else if ( n == 2 ) { for ( int i = 0 ; i < m ; i ++ ) res = res + B [ i ] * m ; } else { int [ ] f = new int [ n ] ; f [ 0 ] = 0 ; f [ 1 ] = 1 ; for ( int i = 2 ; i < n ; i ++ ) f [ i ] = f [ i - 1 ] + f [ i - 2 ] ; for ( int i = 0 ; i < m ; i ++ ) { res = res + ( m * ( B [ i ] * f [ n - 1 ] ) ) + ( m * ( A [ i ] * f [ n - 2 ] ) ) ; } } return res ; } public static void Main ( String [ ] args ) { int [ ] A = { 1 , 2 , 3 } ; int [ ] B = { 4 , 5 , 6 } ; int n = 3 ; int m = A . Length ; Console . WriteLine ( sumNth ( A , B , m , n ) ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static void Main ( ) { int a = 5 ; int AC = a ; int CE = 2 * a ; double shortestDistace = Math . Sqrt ( AC * AC + CE * CE ) ; Console . Write ( shortestDistace ) ; } }

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

Class/struct names: GFG
C# program:
using System ; class GFG { 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 ; } static bool isCousinPrime ( int n1 , int n2 ) { if ( Math . Abs ( n1 - n2 ) != 4 ) { return false ; } else { return ( isPrime ( n1 ) && isPrime ( n2 ) ) ; } } public static void Main ( ) { int n1 = 7 , n2 = 11 ; if ( isCousinPrime ( n1 , n2 ) ) Console . WriteLine ( " YES " ) ; else Console . WriteLine ( " NO " ) ; } }

Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isSemiPrime ( 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 ? true : false ; } 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 ; } static bool isChenPrime ( int n ) { if ( isPrime ( n ) && ( isSemiPrime ( n + 2 ) || isPrime ( n + 2 ) ) ) return true ; else return false ; } public static void Main ( ) { int n = 7 ; if ( isChenPrime ( n ) ) Console . WriteLine ( " YES " ) ; else Console . WriteLine ( " NO " ) ; } }

Accumulator variables: num
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPowerOfTwo ( int n ) { return n != 0 && ( ( n & ( n - 1 ) ) == 0 ) ; } static bool isThabitNumber ( int n ) { n = n + 1 ; if ( n % 3 == 0 ) n = n / 3 ; else return false ; if ( isPowerOfTwo ( n ) ) return true ; else return false ; } public static void Main ( ) { int n = 47 ; if ( isThabitNumber ( n ) ) { Console . WriteLine ( " YES " ) ; } else { Console . WriteLine ( " NO " ) ; } } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int N = 1000 ; static long [ ] dp = new long [ N + 1 ] ; static void sieve ( ) { int [ ] arr = new int [ N + 1 ] ; arr [ 0 ] = 1 ; arr [ 1 ] = 1 ; for ( int i = 2 ; i <= Math . Sqrt ( N ) ; i ++ ) if ( arr [ i ] == 0 ) for ( int j = i * i ; j <= N ; j += i ) arr [ j ] = 1 ; long runningPrimeSum = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { if ( arr [ i ] == 0 ) runningPrimeSum += i ; dp [ i ] = runningPrimeSum ; } } public static void Main ( ) { int l = 4 , r = 13 ; sieve ( ) ; Console . WriteLine ( dp [ r ] - dp [ l - 1 ] ) ; } }

Index/key variables: i, j, r
Accumulator variables: i, j, runningPrimeSum
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int findMinEqualSums ( int [ ] a , int N ) { int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { sum += a [ i ] ; } int sum1 = 0 , sum2 = 0 ; int min = int . MaxValue ; for ( int i = 0 ; i < N ; i ++ ) { sum1 += a [ i ] ; sum2 = sum - sum1 ; if ( Math . Abs ( sum1 - sum2 ) < min ) { min = Math . Abs ( sum1 - sum2 ) ; } if ( min == 0 ) { break ; } } return min ; } public static void Main ( ) { int [ ] a = { 3 , 2 , 1 , 5 , 7 , 8 } ; int N = a . Length ; Console . WriteLine ( findMinEqualSums ( a , N ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum, sum1
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static double MAX = 10000 ; static bool [ ] prime = new bool [ ( int ) ( MAX + 1.0 ) ] ; static void SieveOfEratosthenes ( ) { for ( int i = 0 ; i <= MAX ; i ++ ) prime [ i ] = true ; prime [ 1 ] = false ; for ( int p = 2 ; p * p <= MAX ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * 2 ; i <= MAX ; i += p ) prime [ i ] = false ; } } } static int solve ( int n ) { int count = 0 , num = 1 ; long sum = 0 ; while ( count < n ) { if ( prime [ num ] ) { sum += num ; count ++ ; } num ++ ; } return ( int ) sum ; } static public void Main ( ) { SieveOfEratosthenes ( ) ; int n = 4 ; Console . WriteLine ( " Sum ▁ of ▁ 1st ▁ N ▁ prime ▁ numbers ▁ are ▁ : " + solve ( n ) ) ; } }

Index/key variables: i, num, p
Accumulator variables: count, i, num, p, sum
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { static long fact ( int p ) { if ( p <= 1 ) return 1 ; return p * fact ( p - 1 ) ; } static long isPrime ( int p ) { if ( p == 4 ) return 0 ; return ( fact ( p >> 1 ) % p ) ; } static void Main ( ) { if ( isPrime ( 127 ) == 0 ) { Console . WriteLine ( 0 ) ; } else { Console . WriteLine ( 1 ) ; } } } }

Class/struct names: GFG
C# program:
using System ; class GFG { public double CountDigits ( int n ) { if ( n == 1 ) return 1 ; double sum = 0 ; for ( int i = 2 ; i <= n ; ++ i ) { sum += ( ( double ) Math . Log ( i ) / ( double ) Math . Log ( 10 ) ) ; } sum *= n ; return Math . Ceiling ( sum ) ; } public static void Main ( ) { GFG g = new GFG ( ) ; int N = 5 ; Console . WriteLine ( g . CountDigits ( N ) ) ; } }

Accumulator variables: sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int CONS = 32766 ; static void calc ( int [ ] a , int [ ] b , int [ ] lr , int q , int n ) { int M , m , i , l , r , suma , sumb , cc ; cc = 0 ; for ( i = 0 ; i < n - 1 ; ++ i ) { a [ i + 1 ] += a [ i ] ; b [ i + 1 ] += b [ i ] ; } while ( q != 0 ) { l = lr [ cc ++ ] ; r = lr [ cc ++ ] ; l -= 2 ; r -= 1 ; suma = a [ r ] ; sumb = b [ r ] ; if ( l >= 0 ) { suma -= a [ l ] ; sumb -= b [ l ] ; } M = Math . Max ( CONS * suma + CONS * sumb , - CONS * suma - CONS * sumb ) ; M = Math . Max ( M , Math . Max ( CONS * suma - CONS * sumb , - CONS * suma + CONS * sumb ) ) ; m = Math . Min ( CONS * suma + CONS * sumb , - CONS * suma - CONS * sumb ) ; m = Math . Min ( m , Math . Min ( CONS * suma - CONS * sumb , - CONS * suma + CONS * sumb ) ) ; Console . WriteLine ( ( M - m ) ) ; q -- ; } } public static void Main ( ) { int n = 5 , q = 2 ; int [ ] a = { 0 , 7 , 3 , 4 , 5 } ; int [ ] b = { 0 , 3 , 1 , 2 , 3 } ; int [ ] lr = new int [ q * 2 ] ; lr [ 0 ] = 1 ; lr [ 1 ] = 1 ; lr [ 2 ] = 1 ; lr [ 3 ] = 3 ; calc ( a , b , lr , q , n ) ; } }

Index/key variables: i, l, r
Accumulator variables: cc, l, q, r, suma, sumb
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static long NthTerm ( long n ) { long x = ( 3 * n * n ) % 1000000009 ; return ( x - n + 1000000009 ) % 1000000009 ; } public static void Main ( ) { long N = 4 ; Console . Write ( NthTerm ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int [ ] power = new int [ 31 ] ; static int [ ] pre = new int [ 31 ] ; static void PowerOfTwo ( ) { int x = 1 ; for ( int i = 0 ; i < 31 ; i ++ ) { power [ i ] = x ; x *= 2 ; } pre [ 0 ] = 1 ; for ( int i = 1 ; i < 31 ; i ++ ) pre [ i ] = pre [ i - 1 ] + power [ i ] ; } static int Sum ( int n ) { int ans = n * ( n + 1 ) / 2 ; for ( int i = 0 ; i < 31 ; i ++ ) { if ( power [ i ] > n ) { ans -= 2 * pre [ i - 1 ] ; break ; } } return ans ; } public static void Main ( ) { PowerOfTwo ( ) ; int n = 4 ; Console . WriteLine ( Sum ( n ) ) ; } }

Index/key variables: i
Accumulator variables: ans, i, x
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { 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 void Main ( ) { int n = 17 ; if ( isPrime ( n ) && ( n % 16 == 1 ) ) { Console . WriteLine ( " YES " ) ; } else { Console . WriteLine ( " NO " ) ; } } }

Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findNumber ( int n ) { for ( int i = n - 1 ; i >= 0 ; i -- ) { int [ ] count = new int [ 10 ] ; / * int x = i ; int count1 = 0 , count2 = 0 ; while ( x > 0 ) { count [ x % 10 ] ++ ; x /= 10 ; count1 ++ ; } for ( int j = 0 ; j < 10 ; j ++ ) { if ( count [ j ] == 1 ) count2 ++ ; } if ( count1 == count2 ) return i ; } return - 1 ; } static public void Main ( ) { int n = 8490 ; Console . WriteLine ( findNumber ( n ) ) ; } }

Index/key variables: j
Accumulator variables: count1, count2, i, j, x
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public class Node { public int data ; public Node next ; } ; static bool isPermutation ( Node first , Node second ) { int sum1 = 0 , sum2 = 0 , mul1 = 1 , mul2 = 1 ; Node temp1 = first ; while ( temp1 != null ) { sum1 += temp1 . data ; mul1 *= temp1 . data ; temp1 = temp1 . next ; } Node temp2 = second ; while ( temp2 != null ) { sum2 += temp2 . data ; mul2 *= temp2 . data ; temp2 = temp2 . next ; } return ( ( sum1 == sum2 ) && ( mul1 == mul2 ) ) ; } static Node push ( Node head_ref , int new_data ) { Node new_node = new Node ( ) ; new_node . data = new_data ; new_node . next = head_ref ; head_ref = new_node ; return head_ref ; } public static void Main ( String [ ] args ) { Node first = null ; first = push ( first , 1 ) ; first = push ( first , 34 ) ; first = push ( first , 10 ) ; first = push ( first , 1 ) ; first = push ( first , 35 ) ; first = push ( first , 12 ) ; Node second = null ; second = push ( second , 35 ) ; second = push ( second , 1 ) ; second = push ( second , 12 ) ; second = push ( second , 1 ) ; second = push ( second , 10 ) ; second = push ( second , 34 ) ; if ( isPermutation ( first , second ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Accumulator variables: mul1, mul2, sum1, sum2
Class/struct names: GFG, Node
C# program:
using System ; class GFG { static int __gcd ( int a , int b ) { return b == 0 ? a : __gcd ( b , a % b ) ; } static void solveProportion ( int a , int b1 , int b2 , int c ) { int A = a * b2 ; int B = b1 * b2 ; int C = b1 * c ; int gcd = __gcd ( __gcd ( A , B ) , C ) ; Console . Write ( A / gcd + " : " + B / gcd + " : " + C / gcd ) ; } public static void Main ( ) { int a , b1 , b2 , c ; a = 3 ; b1 = 4 ; b2 = 8 ; c = 9 ; solveProportion ( a , b1 , b2 , c ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int countDivisors ( int n , int k ) { int count = 0 , i ; for ( i = 1 ; i <= n ; i ++ ) { if ( n % i == 0 && i % k == 0 ) { count ++ ; } } return count ; } public static void Main ( ) { int n = 12 , k = 3 ; Console . WriteLine ( countDivisors ( n , k ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static float pi = 3.14159f ; public static float volume ( float r , float h ) { return ( float ) 1 / 3 * pi * h * r * r ; } public static float surface_area ( float r , float s ) { return pi * r * s + pi * r * r ; } public static void Main ( ) { float radius = 5 ; float slant_height = 13 ; float height = 12 ; Console . Write ( " Volume ▁ Of ▁ Cone ▁ : ▁ " ) ; Console . WriteLine ( volume ( radius , height ) ) ; Console . Write ( " Surface ▁ Area ▁ Of ▁ Cone ▁ : ▁ " ) ; Console . WriteLine ( surface_area ( radius , slant_height ) ) ; } }

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

Class/struct names: GFG
C# program:
using System ; class GFG { static int nthTerm ( int n ) { return ( int ) Math . Pow ( n , 2 ) + 2 * n + 2 ; } public static void Main ( ) { int N = 4 ; Console . Write ( nthTerm ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int sum ( int n ) { int ans = ( n * ( n - 1 ) ) / 2 ; return ans ; } public static void Main ( ) { int n = 5 ; Console . WriteLine ( sum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static long getNthTerm ( long N ) { return 4 * ( long ) Math . Pow ( N , 2 ) - 3 * N + 2 ; } static public void Main ( ) { long N = 10 ; Console . Write ( getNthTerm ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static long MOD = 1000000007 ; static long power ( long x , long y , long p ) { long res = 1 ; x = x % p ; while ( y > 0 ) { if ( ( y & 1 ) != 0 ) res = ( res * x ) % p ; x = ( x * x ) % p ; } return res ; } static long sumProd ( long n , long t ) { long dino = power ( t + 1 , MOD - 2 , MOD ) ; long ans = 1 ; for ( long i = n + t + 1 ; i > n ; -- i ) ans = ( ans % MOD * i % MOD ) % MOD ; long tfact = 1 ; for ( int i = 1 ; i <= t ; ++ i ) tfact = ( tfact * i ) % MOD ; ans = ans * dino - tfact + MOD ; return ans % MOD ; } public static void Main ( ) { long n = 3 , t = 2 ; Console . WriteLine ( sumProd ( n , t ) ) ; } }

Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int calculateSum ( int n ) { return ( n * ( ( int ) Math . Pow ( n , 2 ) + 3 * n + 5 ) ) / 3 ; } public static void Main ( ) { int n = 25 ; Console . WriteLine ( calculateSum ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static long mod = 1000000007 ; static long power ( long a , long b ) { long res = 1 ; while ( b != 0 ) { if ( ( b & 1 ) != 0 ) { res *= a ; res %= mod ; } b /= 2 ; a *= a ; a %= mod ; } return res ; } static long minPlayer ( long n , long k ) { long num = ( ( power ( k , n ) - 1 ) + mod ) % mod ; long den = ( power ( k - 1 , mod - 2 ) + mod ) % mod ; long ans = ( ( ( num * den ) % mod ) * k ) % mod ; return ans ; } public static void Main ( ) { long n = 3 , k = 3 ; Console . WriteLine ( minPlayer ( n , k ) ) ; } }

Accumulator variables: a, b, res
Class/struct names: GFG
C# program:
using System ; class GFG { static void sieveOfEratosthenes ( int N , int [ ] s ) { bool [ ] prime = new bool [ N + 1 ] ; for ( int i = 0 ; i < N + 1 ; i ++ ) prime [ i ] = false ; for ( int i = 2 ; i <= N ; i += 2 ) s [ i ] = 2 ; for ( int i = 3 ; i <= N ; i += 2 ) { if ( prime [ i ] == false ) { s [ i ] = i ; for ( int j = i ; j * i <= N ; j += 2 ) { if ( prime [ i * j ] == false ) { prime [ i * j ] = true ; s [ i * j ] = i ; } } } } } static int findSum ( int N ) { int [ ] s = new int [ N + 1 ] ; int ans = 1 ; sieveOfEratosthenes ( N , s ) ; int currFactor = s [ N ] ; int power = 1 ; while ( N > 1 ) { N /= s [ N ] ; if ( currFactor == s [ N ] ) { power ++ ; continue ; } int sum = 0 ; for ( int i = 0 ; i <= power ; i ++ ) sum += ( int ) Math . Pow ( currFactor , i ) ; ans *= sum ; currFactor = s [ N ] ; power = 1 ; } return ans ; } public static void Main ( ) { int n = 12 ; Console . Write ( " Sum ▁ of ▁ the ▁ factors ▁ is ▁ : ▁ " ) ; Console . WriteLine ( findSum ( n ) ) ; } }

Index/key variables: N, i
Accumulator variables: N, ans, i, j, power, sum
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static int count_setbits ( int N ) { int cnt = 0 ; while ( N > 0 ) { cnt += ( N & 1 ) ; N = N >> 1 ; } return cnt ; } static int countMultiples ( int n ) { int [ ] multiple = { 2 , 3 , 5 } ; int count = 0 , mask = ( int ) Math . Pow ( 2 , 3 ) ; for ( int i = 1 ; i < mask ; i ++ ) { int prod = 1 ; for ( int j = 0 ; j < 3 ; j ++ ) { if ( ( i & 1 << j ) > 0 ) prod = prod * multiple [ j ] ; } if ( count_setbits ( i ) % 2 == 1 ) count = count + n / prod ; else count = count - n / prod ; } return count ; } static public void Main ( ) { int n = 10 ; Console . WriteLine ( countMultiples ( n ) ) ; } }

Index/key variables: j
Accumulator variables: cnt, i, j
Iterator variables: i, j
Class/struct names: GFG