Home » C# Basics » 03 - C# Programming - Part 1
3
Decisions
Provides an overview of the functions used when decisoons need to be solved in programming
So far, our codes have been simple. Declare the variables and write statements to process the data using operators and output the result. In real life however, programs are not so simple. Many times, decisions must be taken within the program. For example, we know that if a number is divisible by two, the number is even, otherwise, it is an odd number. In a program that needs to find out if a number is even or odd how how will the C# code be implemented so that the program can make the decision?
C# provides two methods for making decisions:
- if - else
- switch - case