Else

The else statement is used with if statements to provide an alternative code path when the condition is false. It allows your program to handle both true and false cases.

More in C#

  1. Primitive data types
    1. Accessors
      1. Foreach
      2. For
    2. Types
      1. Int
      2. Float
      3. Bool
      4. char
    3. Values
      1. Literal
  2. Non-primitive data types
    1. Structs
    2. Classes
      1. Methods
      2. Fields
    3. Data structures
      1. Arrays
      2. Lists
    4. strings
  3. Control Flow
    1. Loops
    2. Conditionals
      1. else if
      2. return
      3. Else
      4. if
  4. Expressions & Operators
    1. Arithmetic
    2. Assignment

All 48 topics in the Fundamentals Program