In this code snippet, we will learn how to use variables in C#.
A variable is a “container” that holds a value. The value can be any of the many data types in C#. To make a variable you must first declare its data type followed by the name you will use to reference that particular variable. Then you can assign it a value using the = assignment operator.
Let’s see how to declare and use variables in the code example below.