Program to compare m ^ n and n ^ m | CPP program to compare which is greater m ^ n or n ^ m ; function to compare m ^ n and n ^ m ; m ^ n ; n ^ m ; Drivers Code ; function call to compare m ^ n and n ^ m
#include <bits/stdc++.h> NEW_LINE using namespace std ; void check ( unsigned long long m , unsigned long long int n ) { double RHS = m * ( double ) log ( n ) ; double LHS = n * ( double ) log ( m ) ; if ( LHS > RHS ) cout << " m ^ n ▁ > ▁ n ^ m " ; else if ( LHS < RHS ) cout << " m ^ n ▁ < ▁ n ^ m " ; else cout << " m ^ n ▁ = ▁ n ^ m " ; } int main ( ) { unsigned long long m = 987654321 , n = 123456987 ; check ( m , n ) ; return 0 ; }