Pair of integers having difference of their fifth power as X | C # implementation to find a pair of integers A & B such that difference of fifth power is equal to the given number X ; Function to find a pair of integers A & B such that difference of fifth power is equal to the given number X ; Loop to choose every possible pair with in the range ; Check if equation holds ; Driver code ; Function call
using System ; class GFG { static void findPair ( int x ) { int lim = 120 ; for ( int i = - lim ; i <= lim ; i ++ ) { for ( int j = - lim ; j <= lim ; j ++ ) { if ( Math . Pow ( i , 5 ) - Math . Pow ( j , 5 ) == x ) { Console . Write ( i + " ▁ " + j + " STRNEWLINE " ) ; return ; } } } Console . Write ( " - 1" ) ; } public static void Main ( String [ ] args ) { int X = 33 ; findPair ( X ) ; } }