C ++ program to print greater of x ^ y and y ^ x
#include <bits/stdc++.h> NEW_LINE using namespace std ; void printGreater ( double x , double y ) { long double X = y * log ( x ) ; long double Y = x * log ( y ) ; if ( abs ( X - Y ) < 1e-9 ) { cout << " Equal " ; } else if ( X > Y ) { cout << x << " ^ " << y ; } else { cout << y << " ^ " << x ; } }