dhyuti-n/xlcost-variable-roles huggingface dataset:
Java program:
class GFG { static void rgb_to_hsv ( double r , double g , double b ) { r = r / 255.0 ; g = g / 255.0 ; b = b / 255.0 ; double h = - 1 , s = - 1 ; if ( cmax == cmin ) h = 0 ; else if ( cmax == r ) h = ( 60 * ( ( g - b ) / diff ) + 360 ) % 360 ; else if ( cmax == g ) h = ( 60 * ( ( b - r ) / diff ) + 120 ) % 360 ; else if ( cmax == b ) h = ( 60 * ( ( r - g ) / diff ) + 240 ) % 360 ; if ( cmax == 0 ) s = 0 ; else s = ( diff / cmax ) * 100 ; double v = cmax * 100 ; System . out . println ( " ( " + h + " ▁ " + s + " ▁ " + v + " ) " ) ; } public static void main ( String [ ] args ) { rgb_to_hsv ( 129 , 88 , 47 ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int sum_series ( int n ) { int nSquare = n * n ; return nSquare * ( nSquare - 1 ) / 4 ; } public static void main ( String [ ] args ) { int n = 2 ; System . out . println ( sum_series ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static boolean isPrime ( int n ) { if ( n == 0 n == 1 ) return false ; int root = ( int ) Math . sqrt ( n ) ; for ( int i = 2 ; i <= root ; i ++ ) if ( n % i == 0 ) return false ; return true ; } static boolean isSandwitched ( int n ) { return ( isPrime ( n - 1 ) && isPrime ( n + 1 ) ) ; } public static void main ( String [ ] args ) { int n = 642 ; System . out . print ( n + " ▁ : ▁ " ) ; if ( isSandwitched ( n ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; n = 9 ; System . out . print ( n + " ▁ : ▁ " ) ; if ( isSandwitched ( n ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class tomohiko_sakamoto { public static int day_of_the_week ( int y , int m , int d ) { int t [ ] = { 0 , 3 , 2 , 5 , 0 , 3 , 5 , 1 , 4 , 6 , 2 , 4 } ; if ( m < 3 ) y -= 1 ; return ( y + y / 4 - y / 100 + y / 400 + t [ m - 1 ] + d ) % 7 ; } public static void main ( String args [ ] ) { int day = 13 , month = 7 , year = 2017 ; System . out . println ( day_of_the_week ( year , month , day ) ) ; } }

Accumulator variables: y
Class/struct names: tomohiko_sakamoto
Java program:
import java . util . * ; class GFG { static boolean isPrime ( int n , int i ) { if ( n <= 2 ) return ( n == 2 ) ? true : false ; if ( n % i == 0 ) return false ; if ( i * i > n ) return true ; return isPrime ( n , i + 1 ) ; } public static void main ( String [ ] args ) { int n = 15 ; if ( isPrime ( n , 2 ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Class/struct names: GFG
Java program:
class GFG { static boolean isSquareFree ( int n ) { if ( n % 2 == 0 ) n = n / 2 ; if ( n % 2 == 0 ) return false ; for ( int i = 3 ; i <= Math . sqrt ( n ) ; i = i + 2 ) { if ( n % i == 0 ) { n = n / i ; if ( n % i == 0 ) return false ; } } return true ; } public static void main ( String [ ] args ) { int n = 10 ; if ( isSquareFree ( n ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static double findArea ( double d ) { return ( d * d ) / 2 ; } public static void main ( String [ ] args ) { double d = 10 ; System . out . println ( findArea ( d ) ) ; } }

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

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

Class/struct names: GFG
Java program:
class GFG { static float mean ( float arr [ ] , int n ) { float sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum = sum + arr [ i ] ; return sum / n ; } static float SSD ( float arr [ ] , int n ) { float sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum = sum + ( arr [ i ] - mean ( arr , n ) ) * ( arr [ i ] - mean ( arr , n ) ) ; return ( float ) Math . sqrt ( sum / ( n - 1 ) ) ; } static float sampleError ( float arr [ ] , int n ) { return SSD ( arr , n ) / ( float ) Math . sqrt ( n ) ; } public static void main ( String [ ] args ) { float arr [ ] = { 78.53f , 79.62f , 80.25f , 81.05f , 83.21f , 83.46f } ; int n = arr . length ; System . out . println ( sampleError ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . lang . * ; class GFG { static int StepstoReachTarget ( int target ) { target = Math . abs ( target ) ; int n = ( int ) Math . ceil ( ( - 1.0 + ( int ) Math . sqrt ( 1 + 8.0 * target ) ) / 2 ) ; int sum = n * ( n + 1 ) / 2 ; if ( sum == target ) return n ; int d = sum - target ; if ( ( d & 1 ) == 0 ) return n ; else return n + ( ( n & 1 ) != 0 ? 2 : 1 ) ; } public static void main ( String [ ] arg ) { int target = 5 ; System . out . println ( StepstoReachTarget ( target ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static double seriesSum ( int n ) { int i = 1 ; double res = 0.0 ; boolean sign = true ; while ( n > 0 ) { n -- ; if ( sign ) { sign = ! sign ; res = res + ( double ) ++ i / ++ i ; } else { sign = ! sign ; res = res - ( double ) ++ i / ++ i ; } } return res ; } public static void main ( String [ ] args ) { int n = 5 ; System . out . print ( seriesSum ( n ) ) ; } }

Accumulator variables: n
Boolean variables: sign
Class/struct names: GFG
Java program:
import java . io . * ; import java . util . * ; class GFG { static int countSymmetric ( int n ) { if ( n == 0 ) return 1 ; return 1 << ( ( n * ( n + 1 ) ) / 2 ) ; } public static void main ( String [ ] args ) { int n = 3 ; System . out . println ( countSymmetric ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int centeredNonagonal ( int n ) { return ( 3 * n - 2 ) * ( 3 * n - 1 ) / 2 ; } public static void main ( String args [ ] ) { int n = 10 ; System . out . println ( centeredNonagonal ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static float Mean ( float arr [ ] , int n ) { float sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum = sum + arr [ i ] ; return sum / n ; } static float meanAbsDevtion ( float arr [ ] , int n ) { float absSum = 0 ; for ( int i = 0 ; i < n ; i ++ ) absSum = absSum + Math . abs ( arr [ i ] - Mean ( arr , n ) ) ; return absSum / n ; } public static void main ( String [ ] args ) { float arr [ ] = { 10 , 15 , 15 , 17 , 18 , 21 } ; int n = arr . length ; System . out . println ( meanAbsDevtion ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class Ratio { static boolean isRatioPossible ( int lowCost , int upCost , int lowQuant , int upQuant , int r ) { for ( int i = lowQuant ; i <= upQuant ; i ++ ) { int ans = i * r ; if ( lowCost <= ans && ans <= upCost ) return true ; } return false ; } public static void main ( String args [ ] ) { int lowCost = 14 , upCost = 30 , lowQuant = 5 , upQuant = 12 , r = 9 ; if ( isRatioPossible ( lowCost , upCost , lowQuant , upQuant , r ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: Ratio
Java program:
import java . io . * ; class GFG { static void findNumbers ( int n , int d ) { for ( int i = 0 ; i < n - 2 ; i ++ ) System . out . print ( "1" + " ▁ " ) ; System . out . print ( "2" + " ▁ " ) ; System . out . println ( n + d ) ; } public static void main ( String args [ ] ) { int N = 3 , D = 5 ; findNumbers ( N , D ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static long oddNumSum ( int n ) { return ( n * ( 2 * n + 1 ) * ( 24 * n * n * n - 12 * n * n - 14 * n + 7 ) ) / 15 ; } public static void main ( String [ ] args ) { int n = 4 ; System . out . println ( oddNumSum ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int trailingZero ( int x ) { int i = 5 , count = 0 ; while ( x > i ) { count = count + x / i ; i = i * 5 ; } return count ; } static int countProductTrailing ( int M , int N ) { return trailingZero ( N ) + trailingZero ( M ) ; } public static void main ( String args [ ] ) { int N = 67 , M = 98 ; System . out . println ( countProductTrailing ( N , M ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static boolean isTrimorphic ( int N ) { int cube = N * N * N ; while ( N > 0 ) { if ( N % 10 != cube % 10 ) return false ; N /= 10 ; cube /= 10 ; } return true ; } public static void main ( String [ ] args ) { int N = 24 ; if ( isTrimorphic ( N ) == true ) System . out . println ( " trimorphic " ) ; else System . out . println ( " not ▁ trimorphic " ) ; } }

Accumulator variables: N, cube
Class/struct names: GFG
Java program:
class GFG { static int INT_MAX = 2147483647 ; static boolean checkTrimorphic ( int num ) { int cube = num * num * num ; while ( num > 0 ) { if ( num % 10 != cube % 10 ) return false ; num /= 10 ; cube /= 10 ; } return true ; } static int nthTrimorphic ( int n ) { int count = 0 ; for ( int i = 0 ; i < INT_MAX ; i ++ ) { if ( checkTrimorphic ( i ) ) count ++ ; if ( count == n ) return i ; } return - 1 ; } public static void main ( String [ ] args ) { int n = 9 ; System . out . println ( nthTrimorphic ( n ) ) ; } }

Accumulator variables: count, cube, i, num
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; import java . math . * ; class GFG { static int reachTarget ( int target ) { target = Math . abs ( target ) ; int sum = 0 , step = 0 ; while ( sum < target || ( sum - target ) % 2 != 0 ) { step ++ ; sum += step ; } return step ; } public static void main ( String args [ ] ) { int target = 5 ; System . out . println ( reachTarget ( target ) ) ; } }

Accumulator variables: step, sum
Class/struct names: GFG
Java program:
import java . util . * ; public class palindrome_selfie { Set < Integer > all_permutes = new HashSet < Integer > ( ) ; public palindrome_selfie ( int num ) { number = num ; } public int palindrome ( int num ) { int reversednum = 0 ; int d ; while ( num > 0 ) { reversednum = reversednum * 10 + d ; } return reversednum ; } public void palin_selfie ( ) { int l = String . valueOf ( number ) . length ( ) - 1 ; all_permutes . remove ( palindrome ( number ) ) ; all_permutes . remove ( number ) ; Iterator it = all_permutes . iterator ( ) ; while ( it . hasNext ( ) ) { int number2 = ( int ) it . next ( ) ; if ( number * palindrome ( number ) == number2 * palindrome ( number2 ) ) { System . out . println ( " Palindrome ▁ multiplicative " + " selfie ▁ of ▁ " + number + " ▁ is ▁ : ▁ " + number2 ) ; break ; } } if ( flag == false ) { System . out . println ( " Given ▁ number ▁ has ▁ no ▁ palindrome ▁ selfie . " ) ; } } public void permute ( int num , int l , int r ) { if ( l == r ) all_permutes . add ( num ) ; else { for ( int i = l ; i <= r ; i ++ ) { num = swap ( num , l , i ) ; permute ( num , l + 1 , r ) ; } } } public int swap ( int num , int i , int j ) { char temp ; char [ ] charArray = String . valueOf ( num ) . toCharArray ( ) ; temp = charArray [ i ] ; charArray [ i ] = charArray [ j ] ; charArray [ j ] = temp ; return Integer . valueOf ( String . valueOf ( charArray ) ) ; } public static void main ( String args [ ] ) { palindrome_selfie example1 = new palindrome_selfie ( 145572 ) ; example1 . palin_selfie ( ) ; palindrome_selfie example2 = new palindrome_selfie ( 19362 ) ; example2 . palin_selfie ( ) ; palindrome_selfie example3 = new palindrome_selfie ( 4669 ) ; example3 . palin_selfie ( ) ; } }

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

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int unitDigitXRaisedY ( int x , int y ) { int res = 1 ; for ( int i = 0 ; i < y ; i ++ ) res = ( res * x ) % 10 ; return res ; } public static void main ( String args [ ] ) throws IOException { System . out . println ( unitDigitXRaisedY ( 4 , 2 ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static class pair { float first , second ; public pair ( float first , float second ) { this . first = first ; this . second = second ; } } static Vector < pair > Vector ; static float sigma_fx ( pair [ ] a ) { float sum = 0 ; for ( pair i : a ) { sum += i . first * i . second ; } return sum ; } static float sigma_f ( pair [ ] a ) { float sum = 0.0f ; for ( pair i : a ) { sum += i . second ; } return sum ; } static float calculate_mean ( pair [ ] a ) { return sigma_fx ( a ) / sigma_f ( a ) ; } static float calculate_std ( pair [ ] a ) { float f = sigma_f ( a ) ; float mean = sigma_fx ( a ) / f ; float sum = 0 ; for ( pair i : a ) { sum += ( i . first - mean ) * ( i . first - mean ) * i . second ; } return ( float ) Math . sqrt ( sum / f ) ; } public static void main ( String [ ] args ) { pair [ ] A = { new pair ( 0f , 0.1f ) , new pair ( 100f , 0.1f ) , new pair ( 200f , 0.2f ) , new pair ( 333f , 0.3f ) , new pair ( 400f , 0.3f ) } ; pair [ ] B = { new pair ( 100f , 0.1f ) , new pair ( 200f , 0.5f ) , new pair ( 700f , 0.4f ) } ; float avg_A = calculate_mean ( A ) ; float avg_B = calculate_mean ( B ) ; float std_A = calculate_std ( A ) ; float std_B = calculate_std ( B ) ; System . out . print ( " For ▁ Investment ▁ A " + "NEW_LINE"); System . out . print ( " Average : ▁ " + avg_A + "NEW_LINE"); System . out . print ( " Standard ▁ Deviation : ▁ " + std_A + "NEW_LINE"); System . out . print ( " Normalised ▁ Std : ▁ " + std_A / avg_A + "NEW_LINE"); System . out . print ( " For ▁ Investment ▁ B " + "NEW_LINE"); System . out . print ( " Average : ▁ " + avg_B + "NEW_LINE"); System . out . print ( " Standard ▁ Deviation : ▁ " + std_B + "NEW_LINE"); System . out . print ( " Normalised ▁ Std : ▁ " + std_B / avg_B + "NEW_LINE"); if ( ( std_B / avg_B ) < ( std_A / avg_A ) ) System . out . print ( "Investment B is less riskyNEW_LINE"); else System . out . print ( "Investment A is less riskyNEW_LINE"); } }

Accumulator variables: sum
Iterator variables: i
Class/struct names: GFG, pair
Java program:
import java . io . * ; class GFG { static int findDivisor ( int x , int y ) { if ( x == y ) return y ; return 2 ; } public static void main ( String [ ] args ) { int x = 3 , y = 16 ; System . out . println ( findDivisor ( x , y ) ) ; } }

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

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; public class GfG { public static int sumofFactors ( int n ) { if ( n % 2 != 0 ) return 0 ; int res = 1 ; for ( int i = 2 ; i <= Math . sqrt ( n ) ; i ++ ) { int count = 0 , curr_sum = 1 ; int curr_term = 1 ; while ( n % i == 0 ) { count ++ ; n = n / i ; if ( i == 2 && count == 1 ) curr_sum = 0 ; curr_term *= i ; curr_sum += curr_term ; } res *= curr_sum ; } if ( n >= 2 ) res *= ( 1 + n ) ; return res ; } public static void main ( String argc [ ] ) { int n = 18 ; System . out . println ( sumofFactors ( n ) ) ; } }

Accumulator variables: count, curr_sum, curr_term, i, res
Iterator variables: i
Class/struct names: GfG
Java program:
import java . util . * ; class GFG { static class pair { int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static int LCM ( int a , int b ) { return ( a * b ) / ( __gcd ( a , b ) ) ; } static int __gcd ( int a , int b ) { return b == 0 ? a : __gcd ( b , a % b ) ; } static int lcmOfNumerator ( Vector < pair > vect ) { int lcm = vect . get ( 0 ) . first ; for ( int i = 1 ; i < vect . size ( ) ; i ++ ) lcm = LCM ( vect . get ( i ) . first , lcm ) ; return lcm ; } static int gcdOfDemoninators ( Vector < pair > vect ) { int gcd = vect . get ( 0 ) . second ; for ( int i = 1 ; i < vect . size ( ) ; i ++ ) gcd = __gcd ( vect . get ( i ) . second , gcd ) ; return gcd ; } static void lcmOfRationals ( Vector < pair > vect ) { System . out . print ( lcmOfNumerator ( vect ) + " / " + gcdOfDemoninators ( vect ) ) ; } public static void main ( String [ ] args ) { Vector < pair > vect = new Vector < pair > ( ) ; vect . add ( new pair ( 2 , 7 ) ) ; vect . add ( new pair ( 3 , 14 ) ) ; vect . add ( new pair ( 5 , 3 ) ) ; lcmOfRationals ( vect ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG, pair
Java program:
import java . util . * ; import java . lang . * ; public class GfG { public static float focal_length_concave ( float R ) { return R / 2 ; } public static float focal_length_convex ( float R ) { return - ( R / 2 ) ; } public static void main ( String argc [ ] ) { float R = 30 ; System . out . print ( " Focal ▁ length ▁ of " + " spherical ▁ concave " + " mirror ▁ is ▁ : ▁ " + focal_length_concave ( R ) + " unitsNEW_LINE"); System . out . println ( " Focal ▁ length ▁ of " + " spherical ▁ convex " + " mirror ▁ is ▁ : ▁ " + focal_length_convex ( R ) + " ▁ units " ) ; } }

Class/struct names: GfG
Java program:
import java . io . * ; import java . math . * ; class GFG { static int sumofoddFactors ( int n ) { int res = 1 ; while ( n % 2 == 0 ) n = n / 2 ; for ( int i = 3 ; i <= Math . sqrt ( n ) ; i ++ ) { int count = 0 , curr_sum = 1 ; int curr_term = 1 ; while ( n % i == 0 ) { count ++ ; n = n / i ; curr_term *= i ; curr_sum += curr_term ; } res *= curr_sum ; } if ( n >= 2 ) res *= ( 1 + n ) ; return res ; } public static void main ( String args [ ] ) throws IOException { int n = 30 ; System . out . println ( sumofoddFactors ( n ) ) ; } }

Accumulator variables: count, curr_sum, curr_term, i, res
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int countSolutions ( int n , int val ) { int total = 0 ; if ( n == 1 && val >= 0 ) return 1 ; for ( int i = 0 ; i <= val ; i ++ ) { total += countSolutions ( n - 1 , val - i ) ; } return total ; } public static void main ( String [ ] args ) { int n = 5 ; int val = 20 ; System . out . print ( countSolutions ( n , val ) ) ; } }

Accumulator variables: i, total
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static final int N = 6 ; static void fib ( int f [ ] , int n ) { int i ; f [ 0 ] = 0 ; f [ 1 ] = 1 ; for ( i = 2 ; i <= n ; i ++ ) f [ i ] = f [ i - 1 ] + f [ i - 2 ] ; } static void fibcoef ( int fc [ ] [ ] , int f [ ] , int n ) { for ( int i = 0 ; i <= n ; i ++ ) fc [ i ] [ 0 ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j <= i ; j ++ ) { int k = j ; while ( k > 0 ) { k -- ; fc [ i ] [ j ] *= f [ k ] ; } k = 1 ; while ( ( j + 1 ) != k ) fc [ i ] [ j ] /= f [ k ++ ] ; } } } static void printFibonomialTriangle ( int n ) { int f [ ] = new int [ N + 1 ] ; fib ( f , n ) ; int dp [ ] [ ] = new int [ N + 1 ] [ N + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) dp [ i ] [ 0 ] = dp [ i ] [ i ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j < i ; j ++ ) dp [ i ] [ j ] = f [ i - j + 1 ] * dp [ i - 1 ] [ j - 1 ] + f [ j - 1 ] * dp [ i - 1 ] [ j ] ; } for ( int i = 0 ; i <= n ; i ++ ) { for ( int j = 0 ; j <= i ; j ++ ) System . out . print ( dp [ i ] [ j ] + " ▁ " ) ; System . out . println ( ) ; } } public static void main ( String [ ] args ) { int n = 6 ; printFibonomialTriangle ( n ) ; } }

Index/key variables: i, j, k
Accumulator variables: i, j, k
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int sumofNterm ( int a , int d , int b , int r , int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) sum += ( ( a + ( i - 1 ) * d ) * ( b * Math . pow ( r , i - 1 ) ) ) ; return sum ; } public static void main ( String args [ ] ) { int a = 1 , d = 1 , b = 2 , r = 2 , n = 3 ; System . out . println ( sumofNterm ( a , d , b , r , n ) ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int sumOfTheSeries ( int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { int k = 2 ; for ( int j = 1 ; j <= i ; j ++ ) { sum += k ; k += 2 ; } } return sum ; } public static void main ( String [ ] args ) { int n = 5 ; System . out . printf ( " Sum ▁ = ▁ % d " , sumOfTheSeries ( n ) ) ; } }

Accumulator variables: i, j, k, sum
Iterator variables: i, j
Class/struct names: GFG
Java program:
public class GfG { static int sumOfSeries ( int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) sum = sum + i * ( i + 1 ) * ( i + 2 ) ; return sum ; } public static void main ( String s [ ] ) { int n = 10 ; System . out . println ( sumOfSeries ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GfG
Java program:
import java . io . * ; class MathSeries { static double Series ( double x , int n ) { double sum = 1 , term = 1 , fct , j , y = 2 , m ; int i ; for ( i = 1 ; i < n ; i ++ ) { fct = 1 ; for ( j = 1 ; j <= y ; j ++ ) { fct = fct * j ; } term = term * ( - 1 ) ; m = Math . pow ( x , y ) / fct ; m = m * term ; sum = sum + m ; y += 2 ; } return sum ; } public static void main ( String [ ] args ) { double x = 3 ; int n = 4 ; System . out . println ( Math . round ( Series ( x , n ) * 10000.0 ) / 10000.0 ) ; } }

Accumulator variables: i, j, y
Iterator variables: i, j
Class/struct names: MathSeries
Java program:
import java . io . * ; class GFG { static double Series ( double x , int n ) { double sum = 1 , term = 1 , fct = 1 ; double p = 1 , multi = 1 ; for ( int i = 1 ; i < n ; i ++ ) { fct = fct * multi * ( multi + 1 ) ; p = p * x * x ; term = ( - 1 ) * term ; multi += 2 ; sum = sum + ( term * p ) / fct ; } return sum ; } public static void main ( String args [ ] ) { double x = 9 ; int n = 10 ; System . out . printf ( " % .4f " , Series ( x , n ) ) ; } }

Accumulator variables: i, multi
Iterator variables: i
Class/struct names: GFG
Java program:
public class GfG { static int two_factor ( int n ) { int twocount = 0 ; while ( n % 2 == 0 ) { twocount ++ ; n = n / 2 ; } return twocount ; } static int five_factor ( int n ) { int fivecount = 0 ; while ( n % 5 == 0 ) { fivecount ++ ; n = n / 5 ; } return fivecount ; } static int find_con_zero ( int arr [ ] , int n ) { int twocount = 0 ; int fivecount = 0 ; for ( int i = 0 ; i < n ; i ++ ) { twocount += two_factor ( arr [ i ] ) ; fivecount += five_factor ( arr [ i ] ) ; } if ( twocount < fivecount ) return twocount ; else return fivecount ; } public static void main ( String s [ ] ) { int arr [ ] = { 100 , 10 , 5 , 25 , 35 , 14 } ; int n = 6 ; System . out . println ( find_con_zero ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: fivecount, i, twocount
Iterator variables: i
Class/struct names: GfG
Java program:
import java . util . * ; import java . lang . * ; public class GfG { public static int first ( int a , int b , int c ) { a %= b ; for ( int i = 1 ; i <= b ; i ++ ) { a = a * 10 ; if ( a / b == c ) return i ; a %= b ; } return - 1 ; } public static void main ( String argc [ ] ) { int a = 1 , b = 4 , c = 5 ; System . out . println ( first ( a , b , c ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GfG