-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Functional Programming with C#
By :

At its core, an expression in C# is just a piece of code that evaluates to a value. Simple expressions include constants, variables, and method calls. On the other hand, a statement is a standalone unit of code that performs an action. In essence, it is an executable instruction. The best way to understand something is through practice. So, let’s not delay anymore and look at expressions and statements through examples.
Consider the following C# code:
var pagesPerChapter = 20; var totalBookPages = pagesPerChapter * 10;
In this snippet, 20, pagesPerChapter
, 10
, and pagesPerChapter * 10
are all expressions. Each of these pieces of code evaluates to a value.
Now, let’s identify statements:
var pagesPerChapter = 20; var totalBookPages = pagesPerChapter * 10;
Here, var pagesPerChapter = 20; and var totalBookPages = pagesPerChapter * 10; are statements...
Change the font size
Change margin width
Change background colour