C# Tutorials - Herong's Tutorial Examples - v3.32, by Herong Yang
Logical Expressions
This section describes logical expressions - expressions resulting a Boolean value with comparison operations and logical operations.
Logical expression is a way of expressing a logical condition, upon which certain parts of the program execution flow can be altered. For example, a furniture store wants the following delivery charges in its invoice program: if the total amount of an order is less than $200.00, delivery is charged as $25.00; if the amount is greater than or equal to $200.00, delivery is free. Here "amount is less than $200.00" is a logical condition that needs to be entered in C# program as a logical express.
The most simplest logical conditions involves relational operators:
A relational operation can be entered into C# programs as a logical expression with the following syntax:
logical_expression: arithmetic_expression relational_operator arithmetic_expressAfter evaluation, a logical expression will produce a boolean value, true or false.
Examples of logical expressions are:
Table of Contents
►Logical Expressions and Conditional Statements
Visual C# 2010 Express Edition
C# Compiler and Intermediate Language
Compiling C# Source Code Files
MSBuild - Microsoft Build Engine
System.Diagnostics.FileVersionInfo Class
WPF - Windows Presentation Foundation