Comparison and Logical Operators
== != < > <= >= compare and && || ! combine booleans. && and || short circuit.
Example
int age = 25;
bool ok = age >= 18 && age < 65;
Console.WriteLine(ok);
Console.WriteLine(!ok || age == 25);Exercise
Logical and.
a b
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.