Sunday, February 05, 2023 11:14

Posts Tagged ‘variables’

Type modifiers

Tuesday, December 27th, 2016

As you already learned, C# offers 6 base numeric types (int, byte, char, float, double, decimal). In order to explain type modifiers, you should remember that a type defines a set of values that a variable can store and the kind of operations that the program can perform on them.… Read more

Decimal variable type

Tuesday, December 27th, 2016

Decimal variable type, unlike float and double, which are binary point types, is a floating decimal point type. It can store 128 bits, and compared to the float or double types, it has more precision and a smaller range. This makes it best suitable for financial calculations and any situations where precision is crucial.… Read more

Double variable type

Tuesday, December 27th, 2016

C# compiler allocates 64 bits (8 bytes) to store a double variable type. For reference, a double variable type can keep values with a precision of 14 or 15 digits, in the interval between 1.7E-308 and 1.7E+308.

You should know that the float and the double variable types are floating binary point types.… Read more

Float variable type

Tuesday, December 27th, 2016

C# language uses float variable type to store real number values in floating point (negative and positive numbers that contain a fractional part). The C# compiler will allocate 32 bits (4 bytes) to store values of type float. A float variable type can store values with a precision of six or seven decimals in the interval of 3.4E-38 and 3.4E+38.… Read more

Char variable type

Monday, December 26th, 2016

C# language uses char variable type to store values of type character. The C# compiler allocates 16 bits (2 bytes) to store a char variable, which is similar to the ushort type. The char variable type can store integer value types ranging from 0 to 65535.… Read more

Int variable type

Monday, December 26th, 2016

A variable is a name that the compiler assigns to one or more memory location(s). When you declare a variable in a program, you have to specify its type and name. The type of a variable specifies the kind of values that the variable can store and the set of operations that the program can execute on variables.… Read more

Choosing significant variable names

Monday, December 26th, 2016

First of all, this is not a mandatory topic. You can name your variables whatever you like. However, you will soon come to understand that choosing significant variable names is a very good programming practice.

If you ask me, the term “generally accepted programming naming convention” is practically a joke.… Read more

Declaring and initializing variables

Monday, December 26th, 2016

The next topic in our lessons will be declaring and initializing variables. What do those terms mean?

As we already said in a previous lesson, declaring a variable means creating a new variable, by telling the compiler its type and its name.… Read more

Variables

Sunday, December 25th, 2016

If you want your program to perform useful actions, it has to store information. As you might know, every time you run a program, the operating system loads the program’s instructions into the computer’s RAM memory. While running, your program stores values in the memory locations by using variables, just like in mathematics X and Y store a value, therefor being variables.… Read more


Follow the white rabbit