I have a problem in this recursive function that basically takes two numbers and returns the biggest one of them without using comparison (> || < ) operators, thing is, it returns dicremented values even though I held the starting values in a variable.
Here's my code:
#include <stdio.h>
int WhoBig(int A, int B) {
int TrueA=A, TrueB=B;
if(A==0)
{
return TrueB;
}
else if(B==0)
{
return TrueA;
}
else
{
return WhoBig(A-1,B-1);
}
}
void main() {
printf("%d",WhoBig(9,2));
//Output:7
}