Meaning of a small code

int function(int x,int y)
{
return(x||y);
}

what does x||y conveys in return statement.

|| is the boolean OR operator. So “return x||y” will return the value “0” in case both x and y are 0. Else, it will return 1.

1 Like