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:

   arithmetic_expression relational_operator arithmetic_express
After evaluation, a logical expression will produce a boolean value, true or false.

Examples of logical expressions are:

Last update: 2010.

Table of Contents

 About This Book

 Introduction of C# (C Sharp)

 Data Type and Variables

Logical Expressions and Conditional Statements

Logical Expressions

 "if" Statements

 "if" Statements - Example

 "switch" Statements

 "switch" Statements - Example

 Arrays and Loop Statements

 Data Type Features

 Floating-Point Data Types

 Passing Parameters to Methods

 Execution Environment Class

 Visual C# 2010 Express Edition

 Class Features

 C# Compiler and Intermediate Language

 Compiling C# Source Code Files

 MSBuild - Microsoft Build Engine

 Memory Usages of Processes

 Multithreading in C#

 Async Feature from C# 5

 System.IO.FileInfo Class

 System.Diagnostics.FileVersionInfo Class

 WPF - Windows Presentation Foundation

 Partial Classes and Partial Methods

 Outdated Tutorials


 PDF Printing Version