codeparrot/xlcost-text-to-code huggingface dataset:
Find prime numbers in the first half and second half of an array | C # program to print the prime numbers in the first half and second half of an array ; Function to check if a number is prime or not ; Function to find whether elements are prime or not ; Traverse in the given range ; Check if a number is prime or not ; Function to print the prime numbers in the first half and second half of an array ; Driver Code ; Function call
using System ; class GFG { static Boolean prime ( int n ) { for ( int i = 2 ; i * i <= n ; i ++ ) if ( n % i == 0 ) return false ; return true ; } static void prime_range ( int start , int end , int [ ] a ) { for ( int i = start ; i < end ; i ++ ) { if ( prime ( a [ i ] ) ) Console . Write ( a [ i ] + " ▁ " ) ; } } static void Print ( int [ ] arr , int n ) { Console . Write ( " Prime ▁ numbers ▁ in ▁ the ▁ first ▁ half ▁ are ▁ " ) ; prime_range ( 0 , n / 2 , arr ) ; Console . WriteLine ( ) ; Console . Write ( " Prime ▁ numbers ▁ in ▁ the ▁ second ▁ half ▁ are ▁ " ) ; prime_range ( n / 2 , n , arr ) ; Console . WriteLine ( ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 2 , 5 , 10 , 15 , 17 , 21 , 23 } ; int n = arr . Length ; Print ( arr , n ) ; } }
Count of elements that can be deleted without disturbing the mean of the initial array | C # implementation of the approach ; Function to find the elements which do not change the mean on removal ; To store the sum of the array elements ; To store the initial mean ; to store the count of required elements ; Iterate over the array ; Finding the new mean ; If the new mean equals to the initial mean ; Driver code
using System ; class GFG { static int countElements ( int [ ] arr , int n ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum += arr [ i ] ; float mean = ( float ) sum / n ; int cnt = 0 ; for ( int i = 0 ; i < n ; i ++ ) { float newMean = ( float ) ( sum - arr [ i ] ) / ( n - 1 ) ; if ( newMean == mean ) cnt ++ ; } return cnt ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 3 , 4 , 5 } ; int n = arr . Length ; Console . WriteLine ( countElements ( arr , n ) ) ; } }
Find the prime P using given four integers | C # program to possible prime number ; Function to check if a number is prime or not ; Function to find possible prime number ; Find a possible prime number ; Last condition ; Driver code ; Function call
using System ; class GFG { static bool Prime ( int n ) { for ( int j = 2 ; j <= Math . Sqrt ( n ) ; j ++ ) if ( n % j == 0 ) return false ; return true ; } static int find_prime ( int x , int xsqmodp , int y , int ysqmodp ) { int n = x * x - xsqmodp ; int n1 = y * y - ysqmodp ; for ( int j = 2 ; j <= Math . Max ( Math . Sqrt ( n ) , Math . Sqrt ( n1 ) ) ; j ++ ) { if ( n % j == 0 && ( x * x ) % j == xsqmodp && n1 % j == 0 && ( y * y ) % j == ysqmodp ) if ( Prime ( j ) ) return j ; int j1 = n / j ; if ( n % j1 == 0 && ( x * x ) % j1 == xsqmodp && n1 % j1 == 0 && ( y * y ) % j1 == ysqmodp ) if ( Prime ( j1 ) ) return j1 ; j1 = n1 / j ; if ( n % j1 == 0 && ( x * x ) % j1 == xsqmodp && n1 % j1 == 0 && ( y * y ) % j1 == ysqmodp ) if ( Prime ( j1 ) ) return j1 ; } if ( n == n1 ) return n ; return int . MinValue ; } public static void Main ( ) { int x = 3 , xsqmodp = 0 , y = 5 , ysqmodp = 1 ; Console . WriteLine ( find_prime ( x , xsqmodp , y , ysqmodp ) ) ; } }
Time taken per hour for stoppage of Car | C # implementation of the approach ; Function to return the time taken per hour for stoppage ; Driver code
using System ; class GFG { static int numberOfMinutes ( int S , int S1 ) { int Min = 0 ; Min = ( int ) ( ( ( S - S1 ) / Math . Floor ( ( double ) S ) ) * 60 ) ; return Min ; } public static void Main ( ) { int S = 30 , S1 = 10 ; Console . WriteLine ( numberOfMinutes ( S , S1 ) + " ▁ min " ) ; } }
Removing a number from array without changing its arithmetic mean | C # program to remove a number from the array without changing its arithmetic mean ; Function to remove a number from the array without changing its arithmetic mean ; Find sum of all elements ; If mean is an integer ; Check if mean is present in the array or not ; Driver code
using System ; class GFG { static int FindElement ( int [ ] a , int n ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum = sum + a [ i ] ; if ( sum % n == 0 ) { int m = sum / n ; for ( int i = 0 ; i < n ; i ++ ) if ( a [ i ] == m ) return m ; } return - 1 ; } public static void Main ( ) { int [ ] a = { 1 , 2 , 3 , 4 , 5 } ; int n = a . Length ; Console . WriteLine ( FindElement ( a , n ) ) ; } }
Sum of the Tan ( x ) expansion upto N terms | C # program to find tan ( x ) expansion ; Function to find factorial of a number ; To store factorial of a number ; Return the factorial of a number ; Function to find tan ( x ) upto n terms ; To store value of the expansion ; This loop here calculates Bernoulli number which is further used to get the coefficient in the expansion of tan x ; Print the value of expansion ; Driver code ; Function call
using System ; class GFG { static int fac ( int num ) { if ( num == 0 ) return 1 ; int fact = 1 ; for ( int i = 1 ; i <= num ; i ++ ) fact = fact * i ; return fact ; } static void Tanx_expansion ( int terms , int x ) { double sum = 0 ; for ( int i = 1 ; i <= terms ; i += 1 ) { double B = 0 ; int Bn = 2 * i ; for ( int k = 0 ; k <= Bn ; k ++ ) { double temp = 0 ; for ( int r = 0 ; r <= k ; r ++ ) temp = temp + Math . Pow ( - 1 , r ) * fac ( k ) * Math . Pow ( r , Bn ) / ( fac ( r ) * fac ( k - r ) ) ; B = B + temp / ( ( double ) ( k + 1 ) ) ; } sum = sum + Math . Pow ( - 4 , i ) * ( 1 - Math . Pow ( 4 , i ) ) * B * Math . Pow ( x , 2 * i - 1 ) / fac ( 2 * i ) ; } Console . Write ( " { 0 : F9 } " , sum ) ; } public static void Main ( String [ ] args ) { int n = 6 , x = 1 ; Tanx_expansion ( n , x ) ; } }
Minimum elements to be inserted in Array to make adjacent differences equal | C # program for the above approach ; Function to find gcd of two numbers ; Function to calculate minimum numbers to be inserted to make equal differences between two consecutive elements ; Check if there is only one element in the array then answer will be 0 ; Calculate difference between first and second element of array ; If there is only two elements in the array then gcd of differences of consecutive elements of array will be equal to difference of first and second element of the array ; Loop to calculate the gcd of the differences between consecutive elements of the array ; Loop to calculate the elements to be inserted ; Return the answer ; Driver code
using System ; class GFG { static int gcd ( int a , int b ) { if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } static int minimum_elements ( int n , int [ ] arr ) { if ( n < 3 ) return 0 ; int g , ans = 0 , diff , cnt ; diff = arr [ 1 ] - arr [ 0 ] ; g = diff ; for ( int i = 2 ; i < n ; i ++ ) { diff = arr [ i ] - arr [ i - 1 ] ; g = gcd ( g , diff ) ; } for ( int i = 1 ; i < n ; i ++ ) { diff = arr [ i ] - arr [ i - 1 ] ; cnt = diff / g ; ans += ( cnt - 1 ) ; } return ans ; } public static void Main ( ) { int [ ] arr = { 1 , 5 , 8 , 10 , 12 , 16 } ; int n = arr . Length ; Console . WriteLine ( minimum_elements ( n , arr ) ) ; } }
Check if a number is Fermat Pseudoprime | C # program to check if N is Fermat pseudoprime to the base A or not ; Function to check if the given number is composite ; Check if there is any divisor of n less than sqrt ( n ) ; Effectively calculate ( x ^ y ) modulo mod ; Initialize result ; If power is odd , then update the answer ; Square the number and reduce the power to its half ; Return the result ; Function to check for Fermat Pseudoprime ; If it is composite and satisfy Fermat criterion ; Else return 0 ; Driver code ; Function call
using System ; class GFG { static bool checkcomposite ( int n ) { for ( int i = 2 ; i <= Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) return true ; } return false ; } static int power ( int x , int y , int mod ) { int res = 1 ; while ( y != 0 ) { if ( ( y & 1 ) == 1 ) res = ( res * x ) % mod ; y = y >> 1 ; x = ( x * x ) % mod ; } return res ; } static int Check ( int n , int a ) { if ( a > 1 && checkcomposite ( n ) && power ( a , n - 1 , n ) == 1 ) return 1 ; return 0 ; } static public void Main ( ) { int N = 645 ; int a = 2 ; Console . WriteLine ( Check ( N , a ) ) ; } }
Largest and smallest digit of a number | C # program to largest and smallest digit of a number ; Function to the largest and smallest digit of a number ; Find the largest digit ; Find the smallest digit ; Driver code ; Function call
using System ; class GFG { static void Digits ( int n ) { int largest = 0 ; int smallest = 9 ; while ( n != 0 ) { int r = n % 10 ; largest = Math . Max ( r , largest ) ; smallest = Math . Min ( r , smallest ) ; n = n / 10 ; } Console . WriteLine ( largest + " ▁ " + smallest ) ; } public static void Main ( String [ ] args ) { int n = 2346 ; Digits ( n ) ; } }
Probability of distributing M items among X bags such that first bag contains N items | C # program to find probability of first bag to contain N items such that M items are distributed among X bags ; Function to find factorial of a number ; Function to find nCr ; Function to find probability of first bag to contain N items such that M items are distributed among X bags ; Driver code ; Function call
using System ; class GFG { static int factorial ( int n ) { if ( n <= 1 ) return 1 ; return n * factorial ( n - 1 ) ; } static int nCr ( int n , int r ) { return factorial ( n ) / ( factorial ( r ) * factorial ( n - r ) ) ; } static float Probability ( int M , int N , int X ) { return ( float ) ( nCr ( M - N - 1 , X - 2 ) / ( nCr ( M - 1 , X - 1 ) * 1.0 ) ) ; } static void Main ( ) { int M = 9 , X = 3 , N = 4 ; Console . WriteLine ( Probability ( M , N , X ) ) ; } }
Count of N digit numbers possible which satisfy the given conditions | C # implementation of the approach ; Function to return the factorial of n ; Function to return the count of numbers possible ; Driver code
using System ; class GFG { static int fact ( int n ) { int res = 1 ; for ( int i = 2 ; i <= n ; i ++ ) res = res * i ; return res ; } static int Count_number ( int N ) { return ( N * fact ( N ) ) ; } public static void Main ( ) { int N = 2 ; Console . WriteLine ( Count_number ( N ) ) ; } }
Find the count of M character words which have at least one character repeated | C # implementation of the approach ; Function to return the factorial of a number ; Function to return the value of nPr ; Function to return the total number of M length words which have at least a single character repeated more than once ; Driver code
using System ; class GFG { static int fact ( int n ) { if ( n <= 1 ) return 1 ; return n * fact ( n - 1 ) ; } static int nPr ( int n , int r ) { return fact ( n ) / fact ( n - r ) ; } static int countWords ( int N , int M ) { return ( int ) Math . Pow ( N , M ) - nPr ( N , M ) ; } static public void Main ( ) { int N = 10 , M = 5 ; Console . Write ( countWords ( N , M ) ) ; } }
Minimum and maximum possible length of the third side of a triangle | C # implementation of the approach ; Function to find the minimum and the maximum possible length of the third side of the given triangle ; Not a valid triangle ; Not a valid triangle ; Driver code
using System ; class GFG { static void find_length ( int s1 , int s2 ) { if ( s1 <= 0 s2 <= 0 ) { Console . Write ( - 1 ) ; return ; } int max_length = s1 + s2 - 1 ; int min_length = Math . Max ( s1 , s2 ) - Math . Min ( s1 , s2 ) + 1 ; if ( min_length > max_length ) { Console . WriteLine ( - 1 ) ; return ; } Console . WriteLine ( " Max ▁ = ▁ " + max_length ) ; Console . WriteLine ( " Min ▁ = ▁ " + min_length ) ; } public static void Main ( ) { int s1 = 8 , s2 = 5 ; find_length ( s1 , s2 ) ; } }
Number formed by the rightmost set bit in N | C # implementation of the approach ; Function to return the integer formed by taking the rightmost set bit in n ; n & ( n - 1 ) unsets the first set bit from the right in n ; Take xor with the original number The position of the ' changed ▁ bit ' will be set and rest will be unset ; Driver Code
using System ; class geeks { public static int firstSetBit ( int n ) { int x = n & ( n - 1 ) ; return ( n ^ x ) ; } public static void Main ( ) { int n = 12 ; Console . WriteLine ( firstSetBit ( n ) ) ; } }
Number of N length sequences whose product is M | C # implementation of the approach ; Function to calculate the value of ncr effectively ; Initializing the result ; Multiply and divide simultaneously to avoid overflow ; Return the answer ; Function to return the number of sequences of length N such that their product is M ; Hashmap to store the prime factors of M ; Calculate the prime factors of M ; If i divides M it means it is a factor Divide M by i till it could be divided to store the exponent ; Increase the exponent count ; If the number is a prime number greater than sqrt ( M ) ; Initializing the ans ; Multiply the answer for every prime factor ; entry . getValue ( ) represents the exponent of every prime factor ; Return the result ; Driver code
using System ; using System . Collections . Generic ; public class geeks { public static int nCr ( int n , int r ) { int res = 1 ; for ( int i = 1 ; i <= r ; i ++ ) { res *= ( n - r + i ) ; res /= i ; } return res ; } public static int NoofSequences ( int N , int M ) { Dictionary < int , int > prime = new Dictionary < int , int > ( ) ; for ( int i = 2 ; i <= Math . Sqrt ( M ) ; i ++ ) { while ( M % i == 0 ) { if ( ! prime . ContainsKey ( i ) ) prime . Add ( i , 1 ) ; else { int x = prime [ i ] ; prime . Remove ( i ) ; prime . Add ( i , ++ x ) ; } M /= i ; } } if ( M > 1 ) { if ( prime . ContainsKey ( M ) ) { int x = prime [ M ] ; prime . Remove ( M ) ; prime . Add ( M , ++ x ) ; } else prime . Add ( M , 1 ) ; } int ans = 1 ; foreach ( KeyValuePair < int , int > entry in prime ) { ans *= ( nCr ( N + entry . Value - 1 , N - 1 ) ) ; } return ans ; } public static void Main ( String [ ] args ) { int N = 2 , M = 6 ; Console . WriteLine ( NoofSequences ( N , M ) ) ; } }
Number of hours after which the second person moves ahead of the first person if they travel at a given speed | C # implementation of the above approach ; Function to return the number of hours for the second person to move ahead ; Time taken to equalize ; Time taken to move ahead ; Driver code
using System ; class GFG { static int findHours ( int a , int b , int k ) { if ( a >= b ) return - 1 ; int time = k / ( b - a ) ; time = time + 1 ; return time ; } static public void Main ( ) { int a = 4 , b = 5 , k = 1 ; Console . Write ( findHours ( a , b , k ) ) ; } }
Number of ways of distributing N identical objects in R distinct groups with no groups empty | C # implementation of the above approach ; Function to return the value of ncr effectively ; Initialize the answer ; Divide simultaneously by i to avoid overflow ; Function to return the number of ways to distribute N identical objects in R distinct objects ; Driver code
using System ; class GFG { static int ncr ( int n , int r ) { int ans = 1 ; for ( int i = 1 ; i <= r ; i += 1 ) { ans *= ( n - r + i ) ; ans /= i ; } return ans ; } static int NoOfDistributions ( int N , int R ) { return ncr ( N - 1 , R - 1 ) ; } static public void Main ( ) { int N = 4 ; int R = 3 ; Console . WriteLine ( NoOfDistributions ( N , R ) ) ; } }
Number of ways of distributing N identical objects in R distinct groups | C # implementation of the above approach ; Function to return the value of ncr effectively ; Initialize the answer ; Divide simultaneously by i to avoid overflow ; Function to return the number of ways to distribute N identical objects in R distinct objects ; Driver code ; Function call
using System ; class GFG { static int ncr ( int n , int r ) { int ans = 1 ; for ( int i = 1 ; i <= r ; i += 1 ) { ans *= ( n - r + i ) ; ans /= i ; } return ans ; } static int NoOfDistributions ( int N , int R ) { return ncr ( N + R - 1 , R - 1 ) ; } static public void Main ( ) { int N = 4 , R = 3 ; Console . WriteLine ( NoOfDistributions ( N , R ) ) ; } }
Smallest perfect cube in an array | C # implementation of the approach ; Function that returns true if n is a perfect cube ; Takes the sqrt of the number ; Checks if it is a perfect cube number ; Function to return the smallest perfect cube from the array ; Stores the minimum of all the perfect cubes from the array ; Traverse all elements in the array ; Store the minimum if current element is a perfect cube ; Driver code
using System ; class GFG { static bool checkPerfectcube ( int n ) { int d = ( int ) Math . Sqrt ( n ) ; if ( d * d * d == n ) return true ; return false ; } static int smallestPerfectCube ( int [ ] a , int n ) { int mini = int . MaxValue ; for ( int i = 0 ; i < n ; i ++ ) { if ( checkPerfectcube ( a [ i ] ) ) { mini = Math . Min ( a [ i ] , mini ) ; } } return mini ; } static public void Main ( ) { int [ ] a = { 16 , 8 , 25 , 2 , 3 , 10 } ; int n = a . Length ; Console . Write ( smallestPerfectCube ( a , n ) ) ; } }
Find two vertices of an isosceles triangle in which there is rectangle with opposite corners ( 0 , 0 ) and ( X , Y ) | C # program to find two vertices of an isosceles triangle in which there is rectangle with opposite side ( 0 , 0 ) and ( x , y ) ; Function to find two vertices of an isosceles triangle in which there is rectangle with opposite side ( 0 , 0 ) and ( x , y ) ; Required value ; ; print x1 and y1 ; print x2 and y3 ; Driver code ; Function call
using System ; class GFG { static void Vertices ( int x , int y ) { int val = Math . Abs ( x ) + Math . Abs ( y ) ; Console . Write ( val * ( x < 0 ? - 1 : 1 ) + " ▁ 0 ▁ " ) ; Console . Write ( "0 ▁ " + val * ( y < 0 ? - 1 : 1 ) ) ; } public static void Main ( String [ ] args ) { int x = 3 , y = 3 ; Vertices ( x , y ) ; } }
Find a subarray whose sum is divisible by size of the array | C # implementation of above approach ; Function to find a subarray whose sum is a multiple of N ; Prefix sum array to store cumulative sum ; Single state dynamic programming relation for prefix sum array ; Generating all sub - arrays ; If the sum of the sub - array [ i : j ] is a multiple of N ; If the function reaches here it means there are no subarrays with sum as a multiple of N ; Driver code
using System ; class GFG { static void CheckSubarray ( int [ ] arr , int N ) { int [ ] presum = new int [ N + 1 ] ; for ( int i = 1 ; i <= N ; i += 1 ) { presum [ i ] = presum [ i - 1 ] + arr [ i - 1 ] ; } for ( int i = 1 ; i <= N ; i += 1 ) { for ( int j = i ; j <= N ; j += 1 ) { if ( ( presum [ j ] - presum [ i - 1 ] ) % N == 0 ) { Console . Write ( ( i - 1 ) + " ▁ " + ( j - 1 ) ) ; return ; } } } Console . Write ( - 1 ) ; } public static void Main ( ) { int [ ] arr = { 7 , 5 , 3 , 7 } ; int N = arr . Length ; CheckSubarray ( arr , N ) ; } }
Find a subarray whose sum is divisible by size of the array | C # implementation of the approach ; Function to check is there exists a subarray whose sum is a multiple of N ; Prefix sum array to store cumulative sum ; Single state dynamic programming relation for prefix sum array ; Modulo class vector ; Storing the index value in the modulo class vector ; If there exists a sub - array with starting index equal to zero ; In this class , there are more than two presums % N . Hence difference of any two subarrays would be a multiple of N ; 0 based indexing ; Driver code
using System ; using System . Collections . Generic ; class GFG { static void CheckSubarray ( int [ ] arr , int N ) { int [ ] presum = new int [ N + 1 ] ; for ( int i = 1 ; i <= N ; i += 1 ) { presum [ i ] = presum [ i - 1 ] + arr [ i - 1 ] ; } List < int > [ ] moduloclass = new List < int > [ N ] ; for ( int i = 0 ; i < N ; i += 1 ) { moduloclass [ i ] = new List < int > ( ) ; } for ( int i = 1 ; i <= N ; i += 1 ) { moduloclass [ presum [ i ] % N ] . Add ( i - 1 ) ; } if ( moduloclass [ 0 ] . Count > 0 ) { Console . Write ( 0 + " ▁ " + moduloclass [ 0 ] [ 0 ] ) ; return ; } for ( int i = 1 ; i < N ; i += 1 ) { if ( moduloclass [ i ] . Count >= 2 ) { Console . Write ( moduloclass [ i ] [ 0 ] + 1 + " ▁ " + moduloclass [ i ] [ 1 ] ) ; return ; } } } public static void Main ( String [ ] args ) { int [ ] arr = { 7 , 3 , 5 , 2 } ; int N = arr . Length ; CheckSubarray ( arr , N ) ; } }
Smallest number greater or equals to N such that it has no odd positioned bit set | C # implementation of the approach ; Function to count the total bits ; Iterate and find the number of set bits ; Right shift the number by 1 ; Function to find the nearest number ; Count the total number of bits ; To get the position ; If the last set bit is at odd position then answer will always be a number with the left bit set ; Set all the even bits which are possible ; If the number still is less than N ; Return the number by setting the next even set bit ; If we have reached this position it means tempsum > n hence turn off even bits to get the first possible number ; Turn off the bit ; If it gets lower than N then set it and return that number ; Driver code
using System ; class GFG { static int countBits ( int n ) { int count = 0 ; while ( n > 0 ) { count ++ ; n >>= 1 ; } return count ; } static int findNearestNumber ( int n ) { int cnt = countBits ( n ) ; cnt -= 1 ; if ( cnt % 2 == 1 ) { return 1 << ( cnt + 1 ) ; } else { int tempnum = 0 ; for ( int i = 0 ; i <= cnt ; i += 2 ) { tempnum += 1 << i ; } if ( tempnum < n ) { return ( 1 << ( cnt + 2 ) ) ; } else if ( tempnum == n ) { return n ; } for ( int i = 0 ; i <= cnt ; i += 2 ) { tempnum -= ( 1 << i ) ; if ( tempnum < n ) { return tempnum += ( 1 << i ) ; } } } return int . MinValue ; } public static void Main ( ) { int n = 19 ; Console . WriteLine ( findNearestNumber ( n ) ) ; } }
Count of numbers whose 0 th and Nth bits are set | C # implementation of the approach ; Function to return the count of n - bit numbers whose 0 th and nth bits are set ; Driver code
using System ; class GFG { static int countNum ( int n ) { if ( n == 1 ) return 1 ; int count = ( int ) Math . Pow ( 2 , n - 2 ) ; return count ; } static public void Main ( ) { int n = 3 ; Console . WriteLine ( countNum ( n ) ) ; } }
Find a number containing N | C # implementation of above approach ; Function to return the String generated by appending "10" n - 1 times ; Initialising String as empty ; Function to return the decimal equivalent of the given binary String ; Initializing base value to 1 i . e 2 ^ 0 ; Function that calls the constructString and binarytodecimal and returns the answer ; Driver code
using System ; class GFG { static String constructString ( int n ) { String s = " " ; for ( int i = 0 ; i < n ; i ++ ) { s += "10" ; } return s ; } static int binaryToDecimal ( String n ) { String num = n ; int dec_value = 0 ; int base_t = 1 ; int len = num . Length ; for ( int i = len - 1 ; i >= 0 ; i -- ) { if ( num [ i ] == '1' ) dec_value = dec_value + base_t ; base_t = base_t * 2 ; } return dec_value ; } static int findNumber ( int n ) { String s = constructString ( n - 1 ) ; int num = binaryToDecimal ( s ) ; return num ; } static public void Main ( ) { int n = 4 ; Console . Write ( findNumber ( n ) ) ; } }