// The or statement in C# is ||
if (a == b || a == c)
{
// Do something
}
"c# 'or' is '||' and 'and' is '&&'"
//the or operator in c sharp is "||" (key to the left of 1 btw ;))
if(a = 0 || b = 0)
{
//a or b is 0
}
if (2 > 1 || 1 == 1)
{
// 2 is greater than 1 and 1 is equal to 1!
}
float numberOne = 1;
string stringOne = "one";
if (numberOne == 1 || stringOne == "one")
{
print("numberOne or stringOne = 1")
}
int x=15, y=5;
Console.WriteLine("----- Logic Operators -----");
Console.WriteLine(x > 10 || 100 > x);
(a == b || a == c) //Finally a question nobody's freakin' answered!
&& -> and
|| -> or
&& And
|| OR
if (true || false) { //Checks if either side is true
Console.WriteLine("One is true");
}
if (false || false) {
Console.WriteLine("Both are false");
}
//Output:
//One is true