//the and operator in c sharp is "&&" (hold shift and 6 ;))
if(a == 0 && b == 0)
{
//both a and b is 0
}
//The AND (&&) statement will return true if both sides are true,
//otherwise it returns false
if (true && true) { //checks if both sides are true
Console.WriteLine("Both are true");
}
if (false && true) {
Console.WriteLine("One or more is false");
}
//Output:
//Both are true
//The AND Symbol is &
# plz suscribe to my youtube channel -->
# https://www.youtube.com/channel/UC-sfqidn2fKZslHWnm5qe-A
int x=10, y=5;
Console.WriteLine("----- Logic Operators -----");
Console.WriteLine(x > 10 && y < 10);
/* && would work only if both is true for example */ bool a = 1==2 && 1=< 2; // would be false
/* but if they are both true it would be true */ bool a = 1==1 && 1==1; // would be true
&& And
|| OR