Variable Types
Explore the various variable types in C# including integers, floating-point numbers, characters, and booleans. Understand their memory sizes, storage ranges, and how to properly cast values. This lesson helps you grasp fundamental data types needed for effective C# programming.
Integer
An integer is a number that does not have any decimal places. It is a whole number, for example, 1,2,3,4 are all integers. 4.3 is not. If you were to try and place the number 4.3 into an integer, the number would be truncated to 4.
There are further different types in an integer as well. All of them differ in size which we’ll discuss further down the lesson.
Let’s take a look at them one by one.
Float
Floats are floating point ...