and operator in csharp
Code Example - and operator in csharp
# 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);
csharp 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
or operator in csharp
int x=15, y=5;
Console.WriteLine("----- Logic Operators -----");
Console.WriteLine(x > 10 || 100 > x);
logical operators in csharp
int x=20;
Console.WriteLine("----- Logic Operators -----");
Console.WriteLine(x > 10)
and in csharp
/* && 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
csharp logical operators
True
Second operand is evaluated
False