Two non-negative integers x and y are equal if either:
Both are 0, or
x-1 and y-1 are equal
Write a bool -function named equals that recursively determines whether its two int parameters are equal and returns true if they are and false otherwise.
so far here is what i think it should be
1 2 3 4 5 6 7 8 9
bool equals (int x, int y)
{
if (x && y == 0)
returntrue;
elseif (x == y)
returntrue;
elsereturn equals; false;
}
but myprogramminglab says its wrong can somebody help?