Professional Documents
Culture Documents
02 Handout 1
02 Handout 1
A. The if Statement
A conditional statement that executes a block of code when a condition returns a
Boolean value of true.
Can have conditions of any expression, so long as it returns Boolean values (true or
false).
B. Relational Operators
SoloLearn.com
VII.Logical Operators
SoloLearn.com
SoloLearn.com
SoloLearn.com
SoloLearn.com
A. The ?: Operator
Is represented by the question mark (?) and the colon (:) symbols.
An operator used to shorten expressions and structures that require at least three (3)
expressions.
The first expression is evaluated; the resulting Boolean value will then dictate which of
the remaining two (2) remaining expressions are evaluated.
o If the first expression returns a value of true, then the second expression is evaluated
and its resulting value becomes the value of the whole expression.
o If the first expression returns a value of false, then the third expression is evaluated
and its resulting value becomes the value of the whole expression.
References:
SoloLearn. (n.d.). C# tutorial. Retrieved from https://www.sololearn.com/Course/CSharp/
Microsoft (n.d.). Introducing Visual Studio.NET. Retrieved May 2016 from
http://msdn.microsoft.com/en-uslibrary/fc6bk1f4(v=vs.71).aspx.