C# If Statement
Tags:
C#
, 2003
, Language
, Beginning
if (x > y) {
// Your code here
}
Or ...
if (x > y) {
// Your code here
}
else
{
// Alternative code here
}
The If statement is a staple in virtually all programming languages because it allows us to conditionally branch our programming logic by evaluating conditions. We look into the If statement, the Else statement, and how to accomodate multiple lines of code using a curly bracket.