In order to understand how a programming language works, we need to know some basic and essential things first. In this blog I'm going to explain data types that most of the programming languages have and what they do.
First of all, a data type is a representation of a value type and it's used to identify the use of a variable, both for the programmer and the programming language.
Second, there are many data types in programming, and some languages manage them in different ways and with different keywords. However, to make it simpler for you to understand in any programming language, these are the most used and basic data types in programming
Character, String, Int, Float, Double, Boolean
Last, let's explain the aforementioned data types and also give some examples.
Character is used to represent a single letter, number and any symbol.
String is a group of characters that represent a complete text or a single letter, as well.
Int indicates that the value is an integer number either positive or negative.
Float represents a positive/negative decimal number, and so is Double, but double can have more decimal digits. That means double is more precise than float.
Boolean can only have the true or false value and shows off/on or 1/0. Used for conditions as we saw in the last blog.
Conclusion, now you are able to understand what a data type is and how it works. Also, you can put it in practice writing your own code using each one of the data type saw in this blog. Remember, practicing is the best way to learn and thrive.
Comments
Post a Comment