Types of variables in programming Data

Know throughout this article the different types of variables in programming   that exist and each of their data.All the details here !. Below we will indicate the different types of information that exist for programming jargon. There are some very similar or even the same. Types of variables in programming

Types of Variables in programming

First of all we will talk about what a Variable is: It represents a change or undergoes a change. It is characterized by instability, inconstancy and the capacity for change. In other words, it is a symbol that allows the identification of unspecified elements in a group. This set is generally defined as a universal set of variables.

As you can see, variables are elements that exist in formulas, propositions, and algorithms. You can replace or get variables, but when they still belong to the same universe, they can have different values. It is worth mentioning that the value of the variable may be within a certain range or limited by circumstances. There are several types of variables that we will name below: Types of variables in programming

Variable Strings strings:

These are represented in one or many alphanumeric sequences letters, numbers, punctuation. We call them data types or text variables since they are used to store information from this medium or because we want to treat their values ​​as text.

Examples of them: Types of variables in programming

var nif = “12332112W”, city = “Santiago de Compostela”, postal code = “28001”, telephone = “003423145627”; occupation = “biology student”; Types of variables in programming

As we have seen in examples, postal codes or telephones, even if they only contain numbers, we do not want to process them in this way (in terms of applying mathematical operations: add, subtract, compare if they are large or small …). It makes more sense to treat them as text strings, so we enclose their values ​​in quotes.

Booleans variable: Types of variables in programming

The name comes from Boolean logic. They can only take two values: “true” or “false” (true / false). They are widely used in conditional statements. As a switch can equate true / false values ​​to “on” / “off” in this metaphor, even if the program continues to run for one instruction or another: “If true, continue executing X, if so, continue executing Y ”. Types of variables in programming

Numerical data

Types of variables in programming

  • Integer type: These variables contain integer numeric data.
  • Floating point types: they are numerical data with decimals.
  • Dual types: They also contain numeric data with decimals, but unlike floating point numbers, these variables are larger, that is, they can store larger numbers.
  • Char type: These variables contain a single character. For example: A, h, b, 1, 5, … etc., but only one digit.
  • String type: These are not a data type as such.

To create a variable and assign a value to it: <variable type> <variable name> = <value> This is the structure to follow. Some examples will remain in C: int num = 7; Character char = ‘b’

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button