My code 1
function whatRelation($num) {
if ($num === 0) {return “not genetically related”;}
elseif ($num < 3) {return “third cousins”;}
elseif ($num < 6) {return “second cousins”;}
elseif ($num < 14) {return “first cousins”;}
elseif ($num < 35) {return “grandparent and grandchild, aunt/uncle and niece/nephew, or half siblings”;}
elseif ($num < 100) {return “parent and child or full siblings”;}
else {return “identical twins”;}
}
print whatRelation(‘hello’);
Output: third cousins
My code 2
function whatRelation($num) {
if ($num == 0) {return “not genetically related”;}
elseif ($num < 3) {return “third cousins”;}
elseif ($num < 6) {return “second cousins”;}
elseif ($num < 14) {return “first cousins”;}
elseif ($num < 35) {return “grandparent and grandchild, aunt/uncle and niece/nephew, or half siblings”;}
elseif ($num < 100) {return “parent and child or full siblings”;}
else {return “identical twins”;}
}
print whatRelation(‘hello’);
Output: not genetically related
Anyone can explain the difference in the output please.