else Clause
The else clause executes when the if condition is false.
int age = 16;if (age >= 18)Console.WriteLine("Adult");elseConsole.WriteLine("Minor");Run the Application
Section titled “Run the Application”dotnet runResult
Section titled “Result”Minor