OR, AND Operator

2020-06-09 04:47发布

Newbie question. How to calculate the value of the formula A f B, where f - the binary function OR or AND?

8条回答
▲ chillily
2楼-- · 2020-06-09 05:21

I'm not sure if this answers your question, but for example:

if (A || B)
{
    Console.WriteLine("Or");
}

if (A && B)
{
    Console.WriteLine("And");
}
查看更多
Fickle 薄情
3楼-- · 2020-06-09 05:23

many answers above, i will try a different way:

if you are looking for bitwise operations use only one of the marks like:

3 & 1 //==1 - and 4 | 1 //==5 - or

查看更多
登录 后发表回答