dhyuti-n/xlcost-variable-roles huggingface dataset:
Java program:
import java . io . * ; import java . math . * ; class GFG { static int evenSum ( int n ) { int C [ ] [ ] = new int [ n + 1 ] [ n + 1 ] ; int i , j ; for ( i = 0 ; i <= n ; i ++ ) { for ( j = 0 ; j <= Math . min ( i , n ) ; j ++ ) { if ( j == 0 j == i ) C [ i ] [ j ] = 1 ; else C [ i ] [ j ] = C [ i - 1 ] [ j - 1 ] + C [ i - 1 ] [ j ] ; } } int sum = 0 ; for ( i = 0 ; i <= n ; i += 2 ) sum += C [ n ] [ i ] ; return sum ; } public static void main ( String args [ ] ) { int n = 4 ; System . out . println ( evenSum ( n ) ) ; } }

Index/key variables: i, j, n
Accumulator variables: i, j, sum
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void triangular_series ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) System . out . printf ( " % d ▁ " ; , i * ( i + 1 ) / 2 ) ; } public static void main ( String [ ] args ) { int n = 5 ; triangular_series ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void checksum ( int n ) { if ( n % 3 == 0 ) System . out . println ( n / 3 - 1 + " ▁ " + n / 3 + " ▁ " + ( n / 3 + 1 ) ) ; else System . out . println ( " - 1" ) ; } public static void main ( String [ ] args ) { int n = 6 ; checksum ( n ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int divisorSum ( int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; ++ i ) sum += ( n / i ) * i ; return sum ; } public static void main ( String args [ ] ) { int n = 4 ; System . out . println ( divisorSum ( n ) ) ; n = 5 ; System . out . println ( divisorSum ( n ) ) ; } }

Accumulator variables: sum
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { public static int sum_all_divisors ( int num ) { int sum = 0 ; for ( int i = 1 ; i <= Math . sqrt ( num ) ; i ++ ) { sum += t1 + t2 ; } return sum ; } public static void main ( String [ ] args ) { int n = 1 ; int sum = sum_all_divisors ( n ) ; System . out . println ( sum ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static double polite ( double n ) { n += 1 ; double base = 2 ; return n + ( Math . log ( ( n + ( Math . log ( n ) / Math . log ( base ) ) ) ) ) / Math . log ( base ) ; } public static void main ( String [ ] args ) { double n = 7 ; System . out . println ( ( int ) polite ( n ) ) ; } }

Accumulator variables: n
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; public class GfG { public static int solve ( int low , int high , int T ) { while ( low <= high ) { int mid = ( low + high ) / 2 ; if ( ( mid * ( mid + 1 ) ) == T ) return mid ; if ( mid > 0 && ( mid * ( mid + 1 ) ) > T && ( mid * ( mid - 1 ) ) <= T ) return mid - 1 ; if ( ( mid * ( mid + 1 ) ) > T ) high = mid - 1 ; else low = mid + 1 ; } return - 1 ; } public static void main ( String argc [ ] ) { int T = 15 ; int ans = solve ( 1 , T , 2 * T ) ; if ( ans != - 1 ) ans -- ; System . out . println ( " Number ▁ of ▁ stair ▁ steps ▁ = ▁ " + ans ) ; } }

Accumulator variables: ans
Class/struct names: GfG
Java program:
import java . util . * ; import java . lang . * ; public class GfG { static Boolean isOverflow ( long a , long b ) { if ( a == 0 b == 0 ) return false ; long result = a * b ; if ( a == result / b ) return false ; else return true ; } public static void main ( String argc [ ] ) { long a = Long . parseLong ( "10000000000" ) ; long b = Long . parseLong ( " - 10000000000" ) ; if ( isOverflow ( a , b ) ) System . out . print ( " Yes " ) ; else System . out . print ( " No " ) ; } }

Class/struct names: GfG
Java program:
import java . util . * ; class Odd { public static int oddSum ( int n ) { int sum = 0 , curr = 1 ; for ( int i = 0 ; i < n ; i ++ ) { sum += curr ; curr += 2 ; } return sum ; } public static void main ( String [ ] args ) { int n = 20 ; System . out . println ( " ▁ Sum ▁ of ▁ first ▁ " + n + " ▁ Odd ▁ Numbers ▁ is : ▁ " + oddSum ( n ) ) ; } }

Accumulator variables: curr, i, sum
Iterator variables: i
Class/struct names: Odd
Java program:
import java . util . * ; class Odd { public static int oddSum ( int n ) { return ( n * n ) ; } public static void main ( String [ ] args ) { int n = 20 ; System . out . println ( " ▁ Sum ▁ of ▁ first ▁ " + n + " ▁ Odd ▁ Numbers ▁ is : ▁ " + oddSum ( n ) ) ; } }

Class/struct names: Odd
Java program:
import java . io . * ; import java . util . * ; class GFG { static void printKPFNums ( int A , int B , int K ) { int p_factors [ ] = new int [ B + 1 ] ; Arrays . fill ( p_factors , 0 ) ; for ( int p = 2 ; p <= B ; p ++ ) if ( p_factors [ p ] == 0 ) for ( int i = p ; i <= B ; i += p ) p_factors [ i ] ++ ; for ( int i = A ; i <= B ; i ++ ) if ( p_factors [ i ] == K ) System . out . print ( i + " ▁ " ) ; } public static void main ( String args [ ] ) { int A = 14 , B = 18 , K = 2 ; printKPFNums ( A , B , K ) ; } }

Index/key variables: i, p
Accumulator variables: i, p
Iterator variables: i, p
Class/struct names: GFG
Java program:
public class GFG { final static int MAX = 100005 ; static void precompute ( int prefix [ ] , int suffix [ ] ) { boolean prime [ ] = new boolean [ MAX ] ; for ( int i = 0 ; i < MAX ; i ++ ) { prime [ i ] = true ; } for ( int i = 2 ; i * i < MAX ; i ++ ) { if ( prime [ i ] ) { for ( int j = i * i ; j < MAX ; j += i ) { prime [ j ] = false ; } } } prefix [ 1 ] = 1 ; suffix [ MAX - 1 ] = ( int ) 1e9 + 7 ; for ( int i = 2 ; i < MAX ; i ++ ) { if ( prime [ i ] ) { prefix [ i ] = i ; } else { prefix [ i ] = prefix [ i - 1 ] ; } } for ( int i = MAX - 2 ; i > 1 ; i -- ) { if ( prime [ i ] ) { suffix [ i ] = i ; } else { suffix [ i ] = suffix [ i + 1 ] ; } } } static int query ( int prefix [ ] , int suffix [ ] , int L , int R ) { if ( prefix [ R ] < L suffix [ L ] > R ) { return 0 ; } else { return prefix [ R ] - suffix [ L ] ; } } public static void main ( String [ ] args ) { int q = 3 ; int L [ ] = { 2 , 2 , 24 } ; int R [ ] = { 5 , 2 , 28 } ; int prefix [ ] = new int [ MAX ] , suffix [ ] = new int [ MAX ] ; precompute ( prefix , suffix ) ; for ( int i = 0 ; i < q ; i ++ ) { System . out . println ( query ( prefix , suffix , L [ i ] , R [ i ] ) ) ; } } }

Index/key variables: L, MAX, R, i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
import static java . lang . Math . pow ; class GFG { static double sum ( int x , int n ) { double i , total = 1.0 ; for ( i = 1 ; i <= n ; i ++ ) total = total + ( Math . pow ( x , i ) / i ) ; return total ; } public static void main ( String [ ] args ) { int x = 2 ; int n = 5 ; System . out . printf ( " % .2f " , sum ( x , n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static boolean isMember ( int a , int d , int x ) { if ( d == 0 ) return ( x == a ) ; return ( ( x - a ) % d == 0 && ( x - a ) / d >= 0 ) ; } public static void main ( String args [ ] ) { int a = 1 , x = 7 , d = 3 ; if ( isMember ( a , d , x ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int binomialCoeff ( int n , int k ) { int [ ] C = new int [ k + 1 ] ; C [ 0 ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = Math . min ( i , k ) ; j > 0 ; j -- ) C [ j ] = C [ j ] + C [ j - 1 ] ; } return C [ k ] ; } static long subsequences ( int a [ ] , int n , int r ) { HashMap < Integer , Integer > left = new HashMap < > ( ) ; HashMap < Integer , Integer > right = new HashMap < > ( ) ; long ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) if ( right . containsKey ( a [ i ] ) ) { right . put ( a [ i ] , right . get ( a [ i ] ) + 1 ) ; } else { right . put ( a [ i ] , 1 ) ; } if ( r == 1 ) { for ( Map . Entry < Integer , Integer > i : right . entrySet ( ) ) { ans += binomialCoeff ( i . getValue ( ) , 3 ) ; } return ans ; } for ( int i = 0 ; i < n ; i ++ ) { long c1 = 0 , c2 = 0 ; if ( a [ i ] % r == 0 ) if ( left . containsKey ( a [ i ] / r ) ) c1 = left . get ( a [ i ] / r ) ; if ( right . containsKey ( a [ i ] ) ) { right . put ( a [ i ] , right . get ( a [ i ] ) - 1 ) ; } else { right . put ( a [ i ] , - 1 ) ; } if ( right . containsKey ( a [ i ] * r ) ) c2 = right . get ( a [ i ] * r ) ; ans += c1 * c2 ; if ( left . containsKey ( a [ i ] ) ) { left . put ( a [ i ] , left . get ( a [ i ] ) + 1 ) ; } else { left . put ( a [ i ] , 1 } } return ans ; } 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 ; System . out . print ( subsequences ( a , n , r ) ) ; } }

Index/key variables: i, j, k
Accumulator variables: ans, i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
class GFG { static boolean sumSquare ( int n ) { for ( long i = 1 ; i * i <= n ; i ++ ) for ( long j = 1 ; j * j <= n ; j ++ ) if ( i * i + j * j == n ) { System . out . println ( i + " ^ 2 ▁ + ▁ " + j + " ^ 2" ) ; return true ; } return false ; } public static void main ( String args [ ] ) { int n = 25 ; if ( sumSquare ( n ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
class GFG { final static int M = 6 ; final static int N = 7 ; static void preCompute ( int mat [ ] [ ] , int prefixCnt [ ] [ ] ) { for ( int i = 0 ; i < M ; i ++ ) { for ( int j = 0 ; j < N ; j ++ ) { if ( mat [ i ] [ j ] == 0 ) { prefixCnt [ i ] [ j ] = 1 ; } else { prefixCnt [ i ] [ j ] = 0 ; } } } for ( int i = 0 ; i < M ; i ++ ) for ( int j = 1 ; j < N ; j ++ ) prefixCnt [ i ] [ j ] += prefixCnt [ i ] [ j - 1 ] ; for ( int i = 1 ; i < M ; i ++ ) for ( int j = 0 ; j < N ; j ++ ) prefixCnt [ i ] [ j ] += prefixCnt [ i - 1 ] [ j ] ; } static int countQuery ( int prefixCnt [ ] [ ] , int pi , int pj , int qi , int qj ) { int cnt = prefixCnt [ qi ] [ qj ] ; if ( pi > 0 ) cnt -= prefixCnt [ pi - 1 ] [ qj ] ; if ( pj > 0 ) cnt -= prefixCnt [ qi ] [ pj - 1 ] ; if ( pi > 0 && pj > 0 ) cnt += prefixCnt [ pi - 1 ] [ pj - 1 ] ; return cnt ; } static void count0s ( int mat [ ] [ ] , int Q [ ] [ ] , int sizeQ ) { int prefixCnt [ ] [ ] = new int [ M ] [ N ] ; preCompute ( mat , prefixCnt ) ; for ( int i = 0 ; i < sizeQ ; i ++ ) { System . out . print ( countQuery ( prefixCnt , Q [ i ] [ 0 ] , Q [ i ] [ 1 ] , Q [ i ] [ 2 ] , Q [ i ] [ 3 ] ) + " ▁ " ) ; } } public static void main ( String [ ] args ) { int mat [ ] [ ] = { { 0 , 1 , 0 , 1 , 1 , 1 , 0 } , { 1 , 0 , 1 , 1 , 1 , 0 , 1 } , { 1 , 1 , 0 , 0 , 1 , 1 , 0 } , { 1 , 1 , 1 , 1 , 1 , 0 , 1 } , { 0 , 0 , 1 , 0 , 1 , 1 , 1 } , { 1 , 1 , 0 , 1 , 1 , 0 , 1 } } ; int Q [ ] [ ] = { { 0 , 1 , 3 , 2 } , { 2 , 2 , 4 , 5 } , { 4 , 3 , 5 , 6 } } ; int sizeQ = Q . length ; count0s ( mat , Q , sizeQ ) ; } }

Index/key variables: M, N, i, j, qi, qj
Accumulator variables: cnt, i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
class GFG { static boolean check ( long a , long b ) { long c = 0 ; while ( a != 0 ) { c = c + a % 10 ; a = a / 10 ; } return ( c == b ) ; } static long root ( long n ) { boolean found = false ; long mx = ( long ) 1E18 ; for ( long i = 0 ; i <= 90 ; i ++ ) { long s = i * i + 4 * n ; long sq = ( long ) Math . sqrt ( s ) ; if ( sq * sq == s && check ( ( sq - i ) / 2 , i ) ) { found = true ; mx = Math . min ( mx , ( sq - i ) / 2 ) ; } } if ( found ) return mx ; else return - 1 ; } public static void main ( String [ ] args ) { long n = 110 ; System . out . println ( root ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Boolean variables: found
Class/struct names: GFG
Java program:
public class base_power { static int calculate ( int n , int power ) { int sum = 0 ; int bp = ( int ) Math . pow ( n , power ) ; while ( bp != 0 ) { int d = bp % 10 ; sum += d ; bp /= 10 ; } return sum ; } public static void main ( String [ ] args ) { int n = 5 ; int power = 4 ; System . out . println ( calculate ( n , power ) ) ; } }

Accumulator variables: bp, sum
Class/struct names: base_power
Java program:
class GFG { static int __gcd ( int a , int b ) { return b == 0 ? a : __gcd ( b , a % b ) ; } static boolean coprime ( int a , int b ) { return ( __gcd ( a , b ) == 1 ) ; } static void pairSum ( int n ) { int mid = n / 2 ; for ( int i = mid ; i >= 1 ; i -- ) { if ( coprime ( i , n - i ) == true ) { System . out . print ( i + " ▁ " + ( n - i ) ) ; break ; } } } public static void main ( String args [ ] ) { int n = 11 ; pairSum ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . Vector ; class GFG { static void modBigNumber ( String num , long m ) { Vector < Integer > vec = new Vector < > ( ) ; long mod = 0 ; for ( int i = 0 ; i < num . length ( ) ; i ++ ) { int digit = num . charAt ( i ) - '0' ; mod = mod * 10 + digit ; int quo = ( int ) ( mod / m ) ; vec . add ( vec . size ( ) , quo ) ; mod = mod % m ; } System . out . print ( " Remainder : " ▁ + ▁ mod ▁ + ▁ " "); System . out . print ( " Quotient ▁ : ▁ " ) ; boolean zeroflag = false ; for ( int i = 0 ; i < vec . size ( ) ; i ++ ) { if ( vec . get ( i ) == 0 && zeroflag == false ) { continue ; } zeroflag = true ; System . out . print ( vec . get ( i ) ) ; } return ; } public static void main ( String [ ] args ) { String num = "14598499948265358486" ; long m = 487 ; modBigNumber ( num , m ) ; } }

Accumulator variables: i
Iterator variables: i
Boolean variables: zeroflag
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int N = ( int ) 1E6 ; static boolean [ ] fourDiv = new boolean [ N + 1 ] ; static void fourDistinctFactors ( ) { boolean [ ] primeAll = new boolean [ N + 1 ] ; for ( int p = 2 ; p * p <= N ; p ++ ) { if ( primeAll [ p ] == false ) { for ( int i = p * 2 ; i <= N ; i += p ) primeAll [ i ] = true ; } } ArrayList < Integer > prime = new ArrayList < Integer > ( ) ; for ( int p = 2 ; p <= N ; p ++ ) if ( ! primeAll [ p ] ) prime . add ( p ) ; for ( int i = 0 ; i < prime . size ( ) ; ++ i ) { int p = prime . get ( i ) ; if ( 1L * p * p * p <= N ) fourDiv [ p * p * p ] = true ; for ( int j = i + 1 ; j < prime . size ( ) ; ++ j ) { int q = prime . get ( j ) ; if ( 1L * p * q > N ) break ; fourDiv [ p * q ] = true ; } } } public static void main ( String [ ] args ) { fourDistinctFactors ( ) ; int num = 10 ; if ( fourDiv [ num ] ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; num = 12 ; if ( fourDiv [ num ] ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Index/key variables: i, num, p
Accumulator variables: i, p
Iterator variables: i, j, p
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int leonardo ( int n ) { int dp [ ] = new int [ n + 1 ] ; dp [ 0 ] = dp [ 1 ] = 1 ; for ( int i = 2 ; i <= n ; i ++ ) dp [ i ] = dp [ i - 1 ] + dp [ i - 2 ] + 1 ; return dp [ n ] ; } public static void main ( String [ ] args ) { System . out . println ( leonardo ( 3 ) ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static void Cholesky_Decomposition ( int [ ] [ ] matrix , int n ) { int [ ] [ ] lower = new int [ n ] [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j <= i ; j ++ ) { int sum = 0 ; if ( j == i ) { for ( int k = 0 ; k < j ; k ++ ) sum += ( int ) Math . pow ( lower [ j ] [ k ] , 2 ) ; lower [ j ] [ j ] = ( int ) Math . sqrt ( matrix [ j ] [ j ] - sum ) ; } else { for ( int k = 0 ; k < j ; k ++ ) sum += ( lower [ i ] [ k ] * lower [ j ] [ k ] ) ; lower [ i ] [ j ] = ( matrix [ i ] [ j ] - sum ) / lower [ j ] [ j ] ; } } } System . out . println ( " ▁ Lower ▁ Triangular TABSYMBOL ▁ Transpose " ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) System . out . print ( lower [ i ] [ j ] + " TABSYMBOL " ) ; System . out . print ( " " ) ; for ( int j = 0 ; j < n ; j ++ ) System . out . print ( lower [ j ] [ i ] + " TABSYMBOL " ) ; System . out . println ( ) ; } } public static void main ( String [ ] args ) { int n = 3 ; int [ ] [ ] matrix = new int [ ] [ ] { { 4 , 12 , - 16 } , { 12 , 37 , - 43 } , { - 16 , - 43 , 98 } } ; Cholesky_Decomposition ( matrix , n ) ; } }

Index/key variables: i, j, k, n
Accumulator variables: i, j, k, sum
Iterator variables: i, j, k
Class/struct names: GFG
Java program:
class GFG { static float sumOfAP ( float a , float d , float n ) { float sum = ( n / 2 ) * ( 2 * a + ( n - 1 ) * d ) ; return sum ; } public static void main ( String [ ] args ) { float n = 20 ; float a = 2.5f , d = 1.5f ; System . out . print ( sumOfAP ( a , d , n ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; class GFG { public static int sumOfSeries ( int n ) { int x ; if ( n % 2 == 0 ) x = ( n / 2 ) * ( n + 1 ) ; else x = ( ( n + 1 ) / 2 ) * n ; return x * x ; } public static void main ( String [ ] args ) { int n = 5 ; System . out . println ( sumOfSeries ( n ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static final int MAX = 10 ; static int findValue ( int arr [ ] , int n ) { int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = 0 ; j < n ; j ++ ) ans = Math . max ( ans , Math . abs ( arr [ i ] - arr [ j ] ) + Math . abs ( i - j ) ) ; return ans ; } public static void main ( String [ ] args ) { int arr [ ] = { 1 , 2 , 3 , 1 } ; int n = arr . length ; System . out . println ( findValue ( arr , n ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int findValue ( int arr [ ] , int n ) { int a [ ] = new int [ n ] ; int b [ ] = new int [ n ] ; int tmp ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = ( arr [ i ] + i ) ; b [ i ] = ( arr [ i ] - i ) ; } int x = a [ 0 ] , y = a [ 0 ] ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] > x ) x = a [ i ] ; if ( a [ i ] < y ) y = a [ i ] ; } int ans1 = ( x - y ) ; x = b [ 0 ] ; y = b [ 0 ] ; for ( int i = 0 ; i < n ; i ++ ) { if ( b [ i ] > x ) x = b [ i ] ; if ( b [ i ] < y ) y = b [ i ] ; } int ans2 = ( x - y ) ; return Math . max ( ans1 , ans2 ) ; } public static void main ( String [ ] args ) { int arr [ ] = { 1 , 2 , 3 , 1 } ; int n = arr . length ; System . out . println ( findValue ( arr , n ) ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int countsubarray ( int array [ ] , int n , int k ) { int count = 0 ; int i , j , mul ; for ( i = 0 ; i < n ; i ++ ) { if ( array [ i ] < k ) count ++ ; mul = array [ i ] ; for ( j = i + 1 ; j < n ; j ++ ) { mul = mul * array [ j ] ; if ( mul < k ) count ++ ; else break ; } } return count ; } public static void main ( String args [ ] ) { int array [ ] = { 1 , 2 , 3 , 4 } ; int k = 10 ; int size = array . length ; int count = countsubarray ( array , size , k ) ; System . out . print ( count ) ; } }

Index/key variables: i, j
Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
class GFG { static int noOfFactors ( int N ) { if ( N == 1 ) return 1 ; int count = 0 ; int ans = 1 ; while ( N % 2 == 0 ) { count ++ ; N = N / 2 ; } ans *= ( count / 3 + 1 ) ; for ( int i = 3 ; i * i <= N ; i = i + 2 ) { count = 0 ; while ( N % i == 0 ) { count ++ ; N = N / i ; } ans *= ( count / 3 + 1 ) ; } return ans ; } public static void main ( String [ ] args ) { int N = 216 ; System . out . print ( noOfFactors ( N ) ) ; } }

Accumulator variables: ans, count
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int MAX = 1000001 ; static int factor [ ] ; static void generatePrimeFactors ( ) { factor [ 1 ] = 1 ; for ( int i = 2 ; i < MAX ; i ++ ) factor [ i ] = i ; for ( int i = 4 ; i < MAX ; i += 2 ) factor [ i ] = 2 ; for ( int i = 3 ; i * i < MAX ; i ++ ) { if ( factor [ i ] == i ) { for ( int j = i * i ; j < MAX ; j += i ) { if ( factor [ j ] == j ) factor [ j ] = i ; } } } } static int calculateNoOFactors ( int n ) { if ( n == 1 ) return 1 ; int ans = 1 ; int dup = factor [ n ] ; int c = 1 ; int j = n / factor [ n ] ; while ( j != 1 ) { if ( factor [ j ] == dup ) c += 1 ; else { dup = factor [ j ] ; ans = ans * ( c + 1 ) ; c = 1 ; } j = j / factor [ j ] ; } ans = ans * ( c + 1 ) ; return ans ; } public static void main ( String [ ] args ) { factor = new int [ MAX ] ; factor [ 0 ] = 0 ; generatePrimeFactors ( ) ; int a [ ] = { 10 , 30 , 100 , 450 , 987 } ; int q = a . length ; for ( int i = 0 ; i < q ; i ++ ) System . out . print ( calculateNoOFactors ( a [ i ] ) + " ▁ " ) ; } }

Index/key variables: MAX, i, j, n
Accumulator variables: c, i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . lang . * ; import java . io . * ; class GFG { public static void digit_product_Sum ( int N ) { int a [ ] = new int [ N + 1 ] ; int product = 1 ; a [ 0 ] = 1 ; for ( int i = 1 ; i <= N ; i ++ ) { product = a [ i - 1 ] / 10 ; if ( product == 0 ) product = 1 ; else product = a [ i - 1 ] % 10 ; int val = a [ i - 1 ] / 10 ; if ( val == 0 ) val = a [ i - 1 ] ; a [ i ] = a [ i - 1 ] + ( val * product ) ; } for ( int i = 0 ; i < N ; i ++ ) System . out . print ( a [ i ] + " ▁ " ) ; } public static void main ( String [ ] args ) { int N = 10 ; digit_product_Sum ( N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . math . * ; class GFG { static float geometricMean ( int arr [ ] , int n ) { float product = 1 ; for ( int i = 0 ; i < n ; i ++ ) product = product * arr [ i ] ; float gm = ( float ) Math . pow ( product , ( float ) 1 / n ) ; return gm ; } public static void main ( String args [ ] ) { int arr [ ] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 } ; int n = arr . length ; System . out . println ( geometricMean ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int SIZE = 4 ; static boolean productOfSingelDgt ( int n ) { if ( n >= 0 && n <= 9 ) return true ; int [ ] prime = { 2 , 3 , 5 , 7 } ; for ( int i = 0 ; i < SIZE && n > 1 ; i ++ ) while ( n % prime [ i ] == 0 ) n = n / prime [ i ] ; return ( n == 1 ) ; } public static void main ( String [ ] args ) { int n = 24 ; if ( productOfSingelDgt ( n ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int findSum ( int n ) { return n * ( n + 1 ) / 2 ; } public static void main ( String args [ ] ) { int n = 5 ; System . out . println ( findSum ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int findSum ( int n ) { if ( n % 2 == 0 ) return ( n / 2 ) * ( n + 1 ) ; else return ( ( n + 1 ) / 2 ) * n ; } public static void main ( String args [ ] ) { int n = 5 ; System . out . println ( findSum ( n ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int maxPrimefactorNum ( int N ) { if ( N < 2 ) return 0 ; boolean [ ] arr = new boolean [ N + 1 ] ; int prod = 1 , res = 0 ; for ( int p = 2 ; p * p <= N ; p ++ ) { if ( arr [ p ] == false ) { for ( int i = p * 2 ; i <= N ; i += p ) arr [ i ] = true ; prod *= p ; if ( prod > N ) return res ; res ++ ; } } return res ; } public static void main ( String [ ] args ) { int N = 500 ; System . out . println ( maxPrimefactorNum ( N ) ) ; } }

Index/key variables: i, p
Accumulator variables: i, p, prod, res
Iterator variables: i, p
Class/struct names: GFG
Java program:
import java . io . * ; class table { public static void main ( String arg [ ] ) { int n = 8 ; int range = 12 ; for ( int i = 1 ; i <= range ; ++ i ) System . out . println ( n + " ▁ * ▁ " + i + " ▁ = ▁ " + n * i ) ; } }

Iterator variables: i
Class/struct names: table