• @[email protected]
    link
    fedilink
    162 years ago

    string taco = variable.ToString()[variable.ToString().Length - 1];

    If (taco == “0” || taco == “2” || taco == “4” || taco == “6” || taco == “8”)

    return true;

    else

    return false;

    Im something of a coding master myself

    • @[email protected]
      link
      fedilink
      32 years ago

      as division is complicated and expensive depending on the size of the numbers you’d usually receive as an input, this could be the most efficient solution. Certainly could have the best worst case if we imagine some 128bit shenanigans.