Largest of two distinct numbers without using any conditional statements or operators | C ++ program for above implementation ; Function to find the largest number ; Drivers code
#include <iostream> NEW_LINE using namespace std ; int largestNum ( int a , int b ) { return a * ( bool ) ( a / b ) + b * ( bool ) ( b / a ) ; } int main ( ) { int a = 22 , b = 1231 ; cout << largestNum ( a , b ) ; return 0 ; }