dhyuti-n/xlcost-variable-roles huggingface dataset:
C++ program:
#include <bits/stdc++.h>
using namespace std ; #define MOD  1000000009
#define ll  long long int
ll power ( ll n ) { if ( n <= 1 ) return 1 ; n -- ; ll res [ 2 ] [ 2 ] = { 1 , 0 , 0 , 1 } ; ll tMat [ 2 ] [ 2 ] = { 2 , 3 , 1 , 0 } ; while ( n ) { if ( n & 1 ) { ll tmp [ 2 ] [ 2 ] ; tmp [ 0 ] [ 0 ] = ( res [ 0 ] [ 0 ] * tMat [ 0 ] [ 0 ] + res [ 0 ] [ 1 ] * tMat [ 1 ] [ 0 ] ) % MOD ; tmp [ 0 ] [ 1 ] = ( res [ 0 ] [ 0 ] * tMat [ 0 ] [ 1 ] + res [ 0 ] [ 1 ] * tMat [ 1 ] [ 1 ] ) % MOD ; tmp [ 1 ] [ 0 ] = ( res [ 1 ] [ 0 ] * tMat [ 0 ] [ 0 ] + res [ 1 ] [ 1 ] * tMat [ 1 ] [ 0 ] ) % MOD ; tmp [ 1 ] [ 1 ] = ( res [ 1 ] [ 0 ] * tMat [ 0 ] [ 1 ] + res [ 1 ] [ 1 ] * tMat [ 1 ] [ 1 ] ) % MOD ; res [ 0 ] [ 0 ] = tmp [ 0 ] [ 0 ] ; res [ 0 ] [ 1 ] = tmp [ 0 ] [ 1 ] ; res [ 1 ] [ 0 ] = tmp [ 1 ] [ 0 ] ; res [ 1 ] [ 1 ] = tmp [ 1 ] [ 1 ] ; } n = n / 2 ; ll tmp [ 2 ] [ 2 ] ; tmp [ 0 ] [ 0 ] = ( tMat [ 0 ] [ 0 ] * tMat [ 0 ] [ 0 ] + tMat [ 0 ] [ 1 ] * tMat [ 1 ] [ 0 ] ) % MOD ; tmp [ 0 ] [ 1 ] = ( tMat [ 0 ] [ 0 ] * tMat [ 0 ] [ 1 ] + tMat [ 0 ] [ 1 ] * tMat [ 1 ] [ 1 ] ) % MOD ; tmp [ 1 ] [ 0 ] = ( tMat [ 1 ] [ 0 ] * tMat [ 0 ] [ 0 ] + tMat [ 1 ] [ 1 ] * tMat [ 1 ] [ 0 ] ) % MOD ; tmp [ 1 ] [ 1 ] = ( tMat [ 1 ] [ 0 ] * tMat [ 0 ] [ 1 ] + tMat [ 1 ] [ 1 ] * tMat [ 1 ] [ 1 ] ) % MOD ; tMat [ 0 ] [ 0 ] = tmp [ 0 ] [ 0 ] ; tMat [ 0 ] [ 1 ] = tmp [ 0 ] [ 1 ] ; tMat [ 1 ] [ 0 ] = tmp [ 1 ] [ 0 ] ; tMat [ 1 ] [ 1 ] = tmp [ 1 ] [ 1 ] ; } return ( res [ 0 ] [ 0 ] * 1 + res [ 0 ] [ 1 ] * 1 ) % MOD ; } int main ( ) { ll n = 3 ; cout << power ( n ) ; return 0 ; }

Accumulator variables: n, stdc
C++ program:
#include <bits/stdc++.h>
using namespace std ; void shuffleArray ( int a [ ] , int n ) { for ( int i = 0 , q = 1 , k = n ; i < n ; i ++ , k ++ , q ++ ) for ( int j = k ; j > i + q ; j -- ) swap ( a [ j - 1 ] , a [ j ] ) ; } int main ( ) { int a [ ] = { 1 , 3 , 5 , 7 , 2 , 4 , 6 , 8 } ; int n = sizeof ( a ) / sizeof ( a [ 0 ] ) ; shuffleArray ( a , n / 2 ) ; for ( int i = 0 ; i < n ; i ++ ) cout << a [ i ] << " ▁ " ; return 0 ; }

Index/key variables: i, j
Accumulator variables: i, j, k, q, stdc
Iterator variables: i, j
C++ program:
#include <bits/stdc++.h>
using namespace std ; bool isFeasible ( int mid , int arr [ ] , int n , int k ) { int pos = arr [ 0 ] ; int elements = 1 ; for ( int i = 1 ; i < n ; i ++ ) { if ( arr [ i ] - pos >= mid ) { pos = arr [ i ] ; elements ++ ; if ( elements == k ) return true ; } } return 0 ; } int largestMinDist ( int arr [ ] , int n , int k ) { sort ( arr , arr + n ) ; int res = -1 ; int left = 1 , right = arr [ n - 1 ] ; while ( left < right ) { int mid = ( left + right ) / 2 ; if ( isFeasible ( mid , arr , n , k ) ) { res = max ( res , mid ) ; left = mid + 1 ; } else right = mid ; } return res ; } int main ( ) { int arr [ ] = { 1 , 2 , 8 , 4 , 9 } ; int n = sizeof ( arr ) / sizeof ( arr [ 0 ] ) ; int k = 3 ; cout << largestMinDist ( arr , n , k ) ; return 0 ; }

Index/key variables: i
Accumulator variables: elements, i, stdc
Iterator variables: i
C++ program:
#include <bits/stdc++.h>
using namespace std ; void findFrequency ( int arr [ ] , int n ) { unordered_map < int , int > mp ; for ( int i = 0 ; i < n ; i ++ ) { mp [ arr [ i ] ] ++ ; } for ( auto i : mp ) { cout << " Element ▁ " << i . first << " ▁ occurs ▁ " << i . second << " ▁ times " << endl ; } } int main ( ) { int arr [ ] = { 1 , 1 , 1 , 2 , 3 , 3 , 5 , 5 , 8 , 8 , 8 , 9 , 9 , 10 } ; int n = sizeof ( arr ) / sizeof ( arr [ 0 ] ) ; findFrequency ( arr , n ) ; return 0 ; }

Index/key variables: i
Accumulator variables: i, stdc
Iterator variables: i
C++ program:
#include <bits/stdc++.h>
using namespace std ; void findSides ( double A , double C , double c ) { double B = 180 - ( A + C ) ; A = A * ( 3.14159 / 180 ) ; C = C * ( 3.14159 / 180 ) ; B = B * ( 3.14159 / 180 ) ; double a = ( c / sin ( C ) ) * sin ( A ) ; double b = ( c / sin ( C ) ) * sin ( B ) ; cout << fixed << setprecision ( 2 ) ; cout << a << endl ; cout << b << endl ; } int main ( ) { double A = 45.0 ; double C = 35.0 ; double c = 23 ; findSides ( A , C , c ) ; return 0 ; }

Accumulator variables: stdc
C++ program:
#include <bits/stdc++.h>
#define MAX  100
using namespace std ; struct Node { char data ; struct Node * left , * right ; } ; struct Node * newNode ( char item ) { struct Node * temp = new Node ; temp -> data = item ; temp -> left = temp -> right = NULL ; return temp ; } void storeAlternate ( Node * root , char arr [ ] , int * index , int l ) { if ( root == NULL ) return ; storeAlternate ( root -> left , arr , index , l + 1 ) ; if ( l % 2 != 0 ) { arr [ * index ] = root -> data ; ( * index ) ++ ; } storeAlternate ( root -> right , arr , index , l + 1 ) ; } void modifyTree ( Node * root , char arr [ ] , int * index , int l ) { if ( root == NULL ) return ; modifyTree ( root -> left , arr , index , l + 1 ) ; if ( l % 2 != 0 ) { root -> data = arr [ * index ] ; ( * index ) ++ ; } modifyTree ( root -> right , arr , index , l + 1 ) ; } void reverse ( char arr [ ] , int n ) { int l = 0 , r = n - 1 ; while ( l < r ) { int temp = arr [ l ] ; arr [ l ] = arr [ r ] ; arr [ r ] = temp ; l ++ ; r -- ; } } void reverseAlternate ( struct Node * root ) { char * arr = new char [ MAX ] ; int index = 0 ; storeAlternate ( root , arr , & index , 0 ) ; reverse ( arr , index ) ; index = 0 ; modifyTree ( root , arr , & index , 0 ) ; } void printInorder ( struct Node * root ) { if ( root == NULL ) return ; printInorder ( root -> left ) ; cout << root -> data << " ▁ " ; printInorder ( root -> right ) ; } int main ( ) { struct Node * root = newNode ( ' a ' ) ; root -> left = newNode ( ' b ' ) ; root -> right = newNode ( ' c ' ) ; root -> left -> left = newNode ( ' d ' ) ; root -> left -> right = newNode ( ' e ' ) ; root -> right -> left = newNode ( ' f ' ) ; root -> right -> right = newNode ( ' g ' ) ; root -> left -> left -> left = newNode ( ' h ' ) ; root -> left -> left -> right = newNode ( ' i ' ) ; root -> left -> right -> left = newNode ( ' j ' ) ; root -> left -> right -> right = newNode ( ' k ' ) ; root -> right -> left -> left = newNode ( ' l ' ) ; root -> right -> left -> right = newNode ( ' m ' ) ; root -> right -> right -> left = newNode ( ' n ' ) ; root -> right -> right -> right = newNode ( ' o ' ) ; cout << " Inorder ▁ Traversal ▁ of ▁ given ▁ tree STRNEWLINE " ; printInorder ( root ) ; reverseAlternate ( root ) ; cout << " Inorder Traversal of modified tree " ; printInorder ( root ) ; return 0 ; }

Index/key variables: MAX, l, r
Accumulator variables: l, r, stdc
Class/struct names: Node
C++ program:
#include <bits/stdc++.h>
using namespace std ; double line_slope ( double a , double b ) { if ( a != 0 ) return - b / a ; else return ( -2 ) ; } void line_equation ( double a , double b , double c , double x1 , double y1 , double alfa ) { double given_slope = line_slope ( a , b ) ; double x = alfa * 3.14159 / 180 ; if ( given_slope == -2 ) { double slope_1 = tan ( x ) ; double slope_2 = tan ( 3.14159 - x ) ; int g = x1 , f = x1 ; g *= ( - slope_1 ) ; g += y1 ; if ( g > 0 ) cout << " y ▁ = ▁ " << slope_1 << " x ▁ + " << g << endl ; if ( g <= 0 ) cout << " y ▁ = ▁ " << slope_1 << " x ▁ " << g << endl ; f *= ( - slope_2 ) ; f += y1 ; if ( f > 0 ) { cout << " y ▁ = ▁ " << slope_2 << " x ▁ + " << f << endl ; } if ( f <= 0 ) cout << " y ▁ = ▁ " << slope_2 << " x ▁ " << f << endl ; return ; } if ( 1 - tan ( x ) * given_slope == 0 ) { cout << " x ▁ = ▁ " << x1 << endl ; } if ( 1 + tan ( x ) * given_slope == 0 ) { cout << " x ▁ = ▁ " << x1 << endl ; } double slope_1 = ( given_slope + tan ( x ) ) / ( 1 - tan ( x ) * given_slope ) ; double slope_2 = ( given_slope - tan ( x ) ) / ( 1 + tan ( x ) * given_slope ) ; int g = x1 , f = x1 ; g *= ( - slope_1 ) ; g += y1 ; if ( g > 0 && 1 - tan ( x ) * given_slope != 0 ) cout << " y ▁ = ▁ " << slope_1 << " x ▁ + " << g << endl ; if ( g <= 0 && 1 - tan ( x ) * given_slope != 0 ) cout << " y ▁ = ▁ " << slope_1 << " x ▁ " << g << endl ; f *= ( - slope_2 ) ; f += y1 ; if ( f > 0 && 1 + tan ( x ) * given_slope != 0 ) { cout << " y ▁ = ▁ " << slope_2 << " x ▁ + " << f << endl ; } if ( f <= 0 && 1 + tan ( x ) * given_slope != 0 ) cout << " y ▁ = ▁ " << slope_2 << " x ▁ " << f << endl ; } int main ( ) { double a = 2 , b = 3 , c = -7 ; double x1 = 4 , y1 = 9 ; double alfa = 30 ; line_equation ( a , b , c , x1 , y1 , alfa ) ; return 0 ; } cout << fixed << setprecision ( 2 ) ;

Accumulator variables: f, g, stdc
C++ program:
#include <bits/stdc++.h>
using namespace std ; double normal_slope ( double a , double b , double x1 , double y1 ) { double g = a / 2 ; double f = b / 2 ; if ( g - x1 == 0 ) return ( -1 ) ; double slope = ( f - y1 ) / ( g - x1 ) ; if ( slope == 0 ) return ( -2 ) ; return slope ; } void normal_equation ( double a , double b , double x1 , double y1 ) { double slope = normal_slope ( a , b , x1 , y1 ) ; if ( slope == -1 ) { cout << " x ▁ = ▁ " << x1 ; } if ( slope == -2 ) { cout << " y ▁ = ▁ " << y1 ; } if ( slope != -1 && slope != -2 ) { x1 *= - slope ; x1 += y1 ; if ( x1 > 0 ) cout << " y ▁ = ▁ " << slope << " x ▁ + ▁ " << x1 ; else cout << " y ▁ = ▁ " << slope << " x ▁ " << x1 ; } } int main ( ) { int a = 4 , b = 6 , c = 5 ; int x1 = 12 , y1 = 14 ; normal_equation ( a , b , x1 , y1 ) ; return 0 ; }

Accumulator variables: stdc, x1
C++ program:
#include <bits/stdc++.h>
using namespace std ; void findSquareSum ( int Coordinates [ ] [ 2 ] , int N ) { long long xq = 0 , yq = 0 ; long long xs = 0 , ys = 0 ; long long res = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int a , b ; a = Coordinates [ i ] [ 0 ] ; b = Coordinates [ i ] [ 1 ] ; res += xq ; res -= 2 * xs * a ; res += i * ( long long ) ( a * a ) ; xq += a * a ; xs += a ; res += yq ; res -= 2 * ys * b ; res += i * ( long long ) b * b ; yq += b * b ; ys += b ; } cout << res ; } int main ( ) { int arr [ ] [ 2 ] = { { 1 , 1 } , { -1 , -1 } , { 1 , -1 } , { -1 , 1 } } ; int N = sizeof ( arr ) / sizeof ( arr [ 0 ] ) ; findSquareSum ( arr , N ) ; return 0 ; }

Index/key variables: i
Accumulator variables: i, res, stdc, xq, xs, yq, ys
Iterator variables: i
C++ program:
#include <bits/stdc++.h>
using namespace std ; int getPointsIns ( int x1 , int y1 , int radius , int x2 , int y2 , vector < pair < int , int > > points ) { int ans = 0 ; for ( int i = 0 ; i < points . size ( ) ; i ++ ) { bool condOne = false , condTwo = false ; if ( ( points [ i ] . second - y2 ) * ( x2 - x1 ) - ( y2 - y1 ) * ( points [ i ] . first - x2 ) >= 0 ) { condOne = true ; } if ( radius >= ( int ) sqrt ( pow ( ( y1 - points [ i ] . second ) , 2 ) + pow ( x1 - points [ i ] . first , 2 ) ) ) { condTwo = true ; } if ( condOne && condTwo ) { ans += 1 ; } } return ans ; } int main ( ) { int X = 0 ; int Y = 0 ; int R = 5 ; int P = 5 ; int Q = 0 ; vector < pair < int , int > > arr = { make_pair ( 2 , 3 ) , make_pair ( 5 , 6 ) , make_pair ( -1 , 4 ) , make_pair ( 5 , 5 ) } ; cout << getPointsIns ( X , Y , R , P , Q , arr ) ; return 0 ; }

Index/key variables: i
Accumulator variables: ans, i, stdc
Iterator variables: i
Boolean variables: condOne, condTwo
C++ program:
#include <bits/stdc++.h>
using namespace std ; void cntPairs ( vector < vector < int > > points , int n , int K ) { int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { int dist = 0 ; for ( int k = 0 ; k < K ; k ++ ) { int temp = ( points [ i ] [ k ] - points [ j ] [ k ] ) ; dist += temp * temp ; } if ( sqrt ( dist ) * sqrt ( dist ) == dist ) { ans += 1 ; } } } cout << ans << endl ; } int main ( ) { int K = 2 ; vector < vector < int > > points = { { 1 , 2 } , { 5 , 5 } , { -2 , 8 } } ; int n = points . size ( ) ; cntPairs ( points , n , K ) ; return 0 ; }

Index/key variables: i, j, k
Accumulator variables: ans, dist, i, j, k, stdc
Iterator variables: i, j, k
C++ program:
#include <bits/stdc++.h>
using namespace std ; double Circumradius ( int a , int b , int c , int d ) { double s = ( a + b + c + d ) / 2.0 ; double radius = sqrt ( ( ( a * b ) + ( c * d ) ) * ( ( a * c ) + ( b * d ) ) * ( ( a * d ) + ( b * c ) ) / ( ( s - a ) * ( s - b ) * ( s - c ) * ( s - d ) ) ) ; return radius / 4 ; } int main ( ) { int A = 3 ; int B = 4 ; int C = 5 ; int D = 6 ; double ans = Circumradius ( A , B , C , D ) ; cout << setprecision ( 3 ) << ans ; return 0 ; }

Accumulator variables: stdc
C++ program:
#include <bits/stdc++.h>
using namespace std ; float Area_of_Triangle ( int a , int b , int k ) { float area = ( float ) ( ( 1 / 2.0 ) * a * b * ( sin ( k ) ) ) ; return area ; } int main ( ) { int a = 9 ; int b = 12 ; int k = 2 ; float ans = Area_of_Triangle ( a , b , k ) ; cout << ans << endl ; }

Accumulator variables: stdc
C++ program:
#include <bits/stdc++.h>
using namespace std ; struct point { double x , y ; } ; void lineFromPoints ( point P , point Q , double & a , double & b , double & c ) { a = Q . y - P . y ; b = P . x - Q . x ; c = a * ( P . x ) + b * ( P . y ) ; } void perpenBisectorFromLine ( point P , point Q , double & a , double & b , double & c ) { point mid_point ; mid_point . x = ( P . x + Q . x ) / 2 ; mid_point . y = ( P . y + Q . y ) / 2 ; c = - b * ( mid_point . x ) + a * ( mid_point . y ) ; double temp = a ; a = - b ; b = temp ; } double LineInterX ( double a1 , double b1 , double c1 , double a2 , double b2 , double c2 ) { double determ = a1 * b2 - a2 * b1 ; double x = ( b2 * c1 - b1 * c2 ) ; x /= determ ; return x ; } double LineInterY ( double a1 , double b1 , double c1 , double a2 , double b2 , double c2 ) { double determ = a1 * b2 - a2 * b1 ; double y = ( a1 * c2 - a2 * c1 ) ; y /= determ ; return y ; } void findPosition ( point P , point Q , point R , point D ) { point r ; double a , b , c ; lineFromPoints ( P , Q , a , b , c ) ; double e , f , g ; lineFromPoints ( Q , R , e , f , g ) ; perpenBisectorFromLine ( P , Q , a , b , c ) ; perpenBisectorFromLine ( Q , R , e , f , g ) ; r . x = LineInterX ( a , b , c , e , f , g ) ; r . y = LineInterY ( a , b , c , e , f , g ) ; double q = ( r . x - P . x ) * ( r . x - P . x ) + ( r . y - P . y ) * ( r . y - P . y ) ; double dis = ( r . x - D . x ) * ( r . x - D . x ) + ( r . y - D . y ) * ( r . y - D . y ) ; if ( dis < q ) { cout << " Point ▁ ( " << D . x << " , ▁ " << D . y << " ) ▁ is ▁ inside ▁ " << " the ▁ circumcircle " ; } else if ( dis == q ) { cout << " Point ▁ ( " << D . x << " , ▁ " << D . y << " ) ▁ lies ▁ on ▁ the ▁ " << " circumcircle " ; } else { cout << " Point ▁ ( " << D . x << " , ▁ " << D . y << " ) ▁ lies ▁ outside " << " ▁ the ▁ circumcircle " ; } } int main ( ) { point A , B , C , D ; A = { 2 , 8 } ; B = { 2 , 1 } ; C = { 4 , 5 } ; D = { 3 , 0 } ; findPosition ( A , B , C , D ) ; return 0 ; }

Accumulator variables: stdc, x, y
Class/struct names: point
C++ program:
#include <bits/stdc++.h>
using namespace std ; float find_angle ( int x , int y , int z ) { int volume = x * x * y ; float ans = 0 ; if ( z < volume / 2 ) { float d = ( x * y * y ) / ( 2.0 * z ) ; ans = atan ( d ) ; } else { z = volume - z ; float d = ( 2 * z ) / ( float ) ( x * x * x ) ; ans = atan ( d ) ; } ans = ( ans * 180 ) / 3.14159265 ; return ans ; } int main ( ) { int x = 12 ; int y = 21 ; int z = 10 ; cout << find_angle ( x , y , z ) << endl ; }

Accumulator variables: stdc
C++ program:
#include <iostream>
using namespace std ; int countOdd ( int n ) { int coun = 0 , m , j , i ; for ( i = n - 2 ; i >= 1 ; i -- ) { if ( i & 1 ) { m = ( n - i ) / 2 ; j = ( i * ( i + 1 ) ) / 2 ; coun += j * m ; } else { m = ( ( n - 1 ) - i ) / 2 ; j = ( i * ( i + 1 ) ) / 2 ; coun += j * m ; } } return coun ; } int countEven ( int n ) { int coun = 0 , m , j , i ; for ( i = n - 2 ; i >= 1 ; i -- ) { if ( i & 1 ) { m = ( ( n - 1 ) - i ) / 2 ; j = ( i * ( i + 1 ) ) / 2 ; coun += j * m ; } else { m = ( n - i ) / 2 ; j = ( i * ( i + 1 ) ) / 2 ; coun += j * m ; } } return coun ; } int main ( ) { int n = 5 ; if ( n & 1 ) cout << countOdd ( n ) ; else cout << countEven ( n ) ; return 0 ; }

Accumulator variables: coun, i
Iterator variables: i
C++ program:
#include <bits/stdc++.h>
using namespace std ; struct contact { string field1 , field2 , field3 ; } ; void buildGraph ( contact arr [ ] , int n , int * mat [ ] ) { for ( int i = 0 ; i < n ; i ++ ) for ( int j = 0 ; j < n ; j ++ ) mat [ i ] [ j ] = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) if ( arr [ i ] . field1 == arr [ j ] . field1 arr [ i ] . field1 == arr [ j ] . field2 arr [ i ] . field1 == arr [ j ] . field3 arr [ i ] . field2 == arr [ j ] . field1 arr [ i ] . field2 == arr [ j ] . field2 arr [ i ] . field2 == arr [ j ] . field3 arr [ i ] . field3 == arr [ j ] . field1 arr [ i ] . field3 == arr [ j ] . field2 arr [ i ] . field3 == arr [ j ] . field3 ) { mat [ i ] [ j ] = 1 ; mat [ j ] [ i ] = 1 ; break ; } } } void DFSvisit ( int i , int * mat [ ] , bool visited [ ] , vector < int > & sol , int n ) { visited [ i ] = true ; sol . push_back ( i ) ; for ( int j = 0 ; j < n ; j ++ ) if ( mat [ i ] [ j ] && ! visited [ j ] ) DFSvisit ( j , mat , visited , sol , n ) ; } void findSameContacts ( contact arr [ ] , int n ) { vector < int > sol ; int * * mat = new int * [ n ] ; for ( int i = 0 ; i < n ; i ++ ) mat [ i ] = new int [ n ] ; bool visited [ n ] ; memset ( visited , 0 , sizeof ( visited ) ) ; buildGraph ( arr , n , mat ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( ! visited [ i ] ) { DFSvisit ( i , mat , visited , sol , n ) ; sol . push_back ( -1 ) ; } } for ( int i = 0 ; i < sol . size ( ) ; i ++ ) if ( sol [ i ] == -1 ) cout << endl ; else cout << sol [ i ] << " ▁ " ; } int main ( ) { contact arr [ ] = { { " Gaurav " , " gaurav @ gmail . com " , " gaurav @ gfgQA . com " } , { " Lucky " , " lucky @ gmail . com " , " + 1234567" } , { " gaurav123" , " + 5412312" , " gaurav123 @ skype . com " } , { " gaurav1993" , " + 5412312" , " gaurav @ gfgQA . com " } , { " raja " , " + 2231210" , " raja @ gfg . com " } , { " bahubali " , " + 878312" , " raja " } } ; int n = sizeof arr / sizeof arr [ 0 ] ; findSameContacts ( arr , n ) ; return 0 ; }

Index/key variables: i, j, n
Accumulator variables: i, j, stdc
Iterator variables: i, j
Class/struct names: contact
C++ program:
#include <bits/stdc++.h>
using namespace std ; float ellipse ( float l , float b ) { if ( l < 0 b < 0 ) return -1 ; float x = ( 3.14 * l * b ) / 4 ; return x ; } int main ( ) { float l = 5 , b = 3 ; cout << ellipse ( l , b ) << endl ; return 0 ; }

Accumulator variables: stdc
C++ program:
/ * C ++ program to determine the number of squares that line will pass through * #include < bits / stdc ++ . h > using namespace std ; int noOfSquares ( int x1 , int y1 , int x2 , int y2 ) { int dx = abs ( x2 - x1 ) ; int dy = abs ( y2 - y1 ) ; int ans = dx + dy - __gcd ( dx , dy ) ; cout << ans ; } int main ( ) { int x1 = 1 , y1 = 1 , x2 = 4 , y2 = 3 ; noOfSquares ( x1 , y1 , x2 , y2 ) ; return 0 ; }

Accumulator variables: C, stdc
C++ program:
#include <bits/stdc++.h>
using namespace std ; #define ll  long long int
ll binomialCoeff ( int n , int k ) { ll res = 1 ; if ( k > n - k ) k = n - k ; for ( int i = 0 ; i < k ; ++ i ) { res *= ( n - i ) ; res /= ( i + 1 ) ; } return res ; } ll countPaths ( int x1 , int y1 , int x2 , int y2 ) { int m = abs ( x1 - x2 ) ; int n = abs ( y1 - y2 ) ; return ( binomialCoeff ( m + n , n ) ) ; } int main ( ) { int x1 = 2 , y1 = 3 , x2 = 4 , y2 = 5 ; cout << countPaths ( x1 , y1 , x2 , y2 ) ; return 0 ; }

Accumulator variables: res, stdc
Iterator variables: i
C++ program:
#include <bits/stdc++.h>
using namespace std ; #define pi  3.1415926
double areaCircle ( double b ) { double area = pi * b * b ; return area ; } int main ( ) { double a = 10 , b = 8 ; cout << areaCircle ( b ) ; return 0 ; }

Accumulator variables: stdc
C++ program:
#include <bits/stdc++.h>
using namespace std ; float findRadiusOfcircumcircle ( float n , float a ) { if ( n < 0 a < 0 ) return -1 ; float radius = a / sqrt ( 2 - ( 2 * cos ( 360 / n ) ) ) ; return radius ; } int main ( ) { float n = 5 , a = 6 ; cout << findRadiusOfcircumcircle ( n , a ) << endl ; return 0 ; }

Accumulator variables: stdc
C++ program:
#include <bits/stdc++.h>
using namespace std ; float findRadiusOfIncircle ( float a , float b , float c ) { if ( a < 0 b < 0 c < 0 ) return -1 ; float p = ( a + b + c ) / 2 ; float area = sqrt ( p * ( p - a ) * ( p - b ) * ( p - c ) ) ; float radius = area / p ; return radius ; } int main ( ) { float a = 2 , b = 2 , c = 3 ; cout << findRadiusOfIncircle ( a , b , c ) << endl ; return 0 ; }

Accumulator variables: stdc
C++ program:
#include <bits/stdc++.h>
using namespace std ; float area ( int x1 , int y1 , int z1 , int x2 , int y2 , int z2 ) { float area = sqrt ( pow ( ( y1 * z2 - y2 * z1 ) , 2 ) + pow ( ( x1 * z2 - x2 * z1 ) , 2 ) + pow ( ( x1 * y2 - x2 * y1 ) , 2 ) ) ; area = area / 2 ; return area ; } int main ( ) { int x1 = -2 ; int y1 = 0 ; int z1 = -5 ; int x2 = 1 ; int y2 = -2 ; int z2 = -1 ; float a = area ( x1 , y1 , z1 , x2 , y2 , z2 ) ; cout << " Area ▁ = ▁ " << a << endl ; return 0 ; }

Accumulator variables: stdc
C++ program:
#include <bits/stdc++.h>
using namespace std ; float trapezoidarea ( float r ) { if ( r < 0 ) return -1 ; float a = ( 3 * sqrt ( 3 ) * pow ( r , 2 ) ) / 4 ; return a ; } int main ( ) { float r = 5 ; cout << trapezoidarea ( r ) << endl ; return 0 ; }

Accumulator variables: stdc
C++ program:
#include <bits/stdc++.h>
using namespace std ; float rectanglearea ( float r ) { if ( r < 0 ) return -1 ; float a = r * r ; return a ; } int main ( ) { float r = 5 ; cout << rectanglearea ( r ) << endl ; return 0 ; }

Accumulator variables: stdc
C++ program:
#include <bits/stdc++.h>
using namespace std ; int maxLines ( int n , int x1 [ ] , int y1 [ ] , int x2 [ ] , int y2 [ ] ) { unordered_set < double > s ; double slope ; for ( int i = 0 ; i < n ; ++ i ) { if ( x1 [ i ] == x2 [ i ] ) slope = INT_MAX ; else slope = ( y2 [ i ] - y1 [ i ] ) * 1.0 / ( x2 [ i ] - x1 [ i ] ) * 1.0 ; s . insert ( slope ) ; } return s . size ( ) ; } int main ( ) { int n = 2 , x1 [ ] = { 1 , 2 } , y1 [ ] = { 1 , 2 } , x2 [ ] = { 2 , 4 } , y2 [ ] = { 2 , 10 } ; cout << maxLines ( n , x1 , y1 , x2 , y2 ) ; return 0 ; }

Index/key variables: i
Accumulator variables: stdc
Iterator variables: i
C++ program:
#include <bits/stdc++.h>
using namespace std ; float area ( float x1 , float y1 , float z1 , float x2 , float y2 , float z2 ) { float area = sqrt ( pow ( ( y1 * z2 - y2 * z1 ) , 2 ) + pow ( ( x1 * z2 - x2 * z1 ) , 2 ) + pow ( ( x1 * y2 - x2 * y1 ) , 2 ) ) ; return area ; } int main ( ) { float x1 = 3 ; float y1 = 1 ; float z1 = -2 ; float x2 = 1 ; float y2 = -3 ; float z2 = 4 ; float a = area ( x1 , y1 , z1 , x2 , y2 , z2 ) ; cout << " Area ▁ = ▁ " << a ; return 0 ; }

Accumulator variables: stdc
C++ program:
#include <bits/stdc++.h>
using namespace std ; int max_intersection ( int * center , int length , int k ) { sort ( center , center + 3 ) ; if ( center [ 2 ] - center [ 0 ] >= 2 * k + length ) { return 0 ; } else if ( center [ 2 ] - center [ 0 ] >= 2 * k ) { return ( 2 * k - ( center [ 2 ] - center [ 0 ] - length ) ) ; } else return length ; } int main ( ) { int center [ 3 ] = { 1 , 2 , 3 } ; int L = 1 ; int K = 1 ; cout << max_intersection ( center , L , K ) ; }

Accumulator variables: stdc
C++ program:
#include <bits/stdc++.h>
using namespace std ; int pentatopeNum ( int n ) { return ( n * ( n + 1 ) * ( n + 2 ) * ( n + 3 ) ) / 24 ; } int main ( ) { int n = 5 ; cout << pentatopeNum ( n ) << endl ; n = 11 ; cout << pentatopeNum ( n ) << endl ; return 0 ; }

Accumulator variables: stdc
C++ program:
#include <bits/stdc++.h>
using namespace std ; int icosidigonal_num ( long int n ) { return ( 20 * n * n - 18 * n ) / 2 ; } int main ( ) { long int n = 4 ; cout << n << " th ▁ Icosidigonal ▁ number ▁ : " << icosidigonal_num ( n ) ; cout << endl ; n = 8 ; cout << n << " th ▁ Icosidigonal ▁ number : " << icosidigonal_num ( n ) ; return 0 ; }

Accumulator variables: stdc
C++ program:
#include <bits/stdc++.h>
using namespace std ; void findPoint ( int x1 , int y1 , int x2 , int y2 ) { cout << " ( " << 2 * x2 - x1 << " , ▁ " << 2 * y2 - y1 << " ) " ; } int main ( ) { int x1 = 0 , y1 = 0 , x2 = 1 , y2 = 1 ; findPoint ( x1 , y1 , x2 , y2 ) ; return 0 ; }

Accumulator variables: stdc