Learn C#: Logic and Conditionals
Learn how to work with Boolean logic and conditional statements in C#.
StartKey Concepts
Review core concepts you need to learn to master this subject
Boolean Expressions
Boolean Type
Logical Operators
Comparison Operators
Truth Tables
Conditional Control
Control Flow
If Statements
Boolean Expressions
Boolean Expressions
// These expressions all evaluate to a boolean value.
// Therefore their values can be stored in boolean variables.
bool a = (2 > 1);
bool b = a && true;
bool c = !false || (7 < 8);
A boolean expression is any expression that evaluates to, or returns, a boolean value.
Understanding Logic in C#
Lesson 1 of 2
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory