+ 5
What is a data type?
8 odpowiedzi
+ 11
In programming we deal with information. Every information is called as 'constant' in our program.
While programming, you may come into a situation where you have to store this information or say "constant" in your program.
To achieve it, we use variable in our program to store data.
Ex: -
int x = 5;
Here x is a variable and 5 is information or constant. But what about "int"????
What is it???
Wait a second buddy. In programming, we also have to tell the compiler " What type or kind of data we want to store" And that type or kind of information is called or referred to as a "data type".
There are built-in or primitive data types in programming which are already defined in a programming language.
Well, you can also create your own data types by simply creating a " Class"!!!!!
Well, it's a Oop topic!! And it is a out of topic thing so I want to put an end to my answer buddy!!!!
Hope you like it!!!!!!
+ 3
A datatype is a set.
For example, the integers are the set { ... , -2, -1, 0, 1, 2, ... }
When you say "variable x is of type integer", you mean that it can only be one of the values in that set, and it can't be anything else (like 1.3, "horse", etc.)
+ 1
That's declare that what is the type of a data
+ 1
Data type is the format of data we input. i.e. whether it is characters, text, integers (whole numbers), decimal values (fractions) etc.
Character is denoted by - char
Text is denoted by - string
Whole numbers - int
Fractions - float or double
Hope it's useful.
+ 1
data type specifies that which type of value of a variable.For example char,int etc
0
Depend your questions behaviour who has to choose your data type i.e int, float,char ok
0
A data type in a programming is a classification that specifies which type of value of a variable like int,float. etc
0
Data type is like the identity of the variable which you declare like in laymen example Delhi is capital and India is country
Delhi capital;
Indian country;
USA country;
Dhaka capital;
And these capital and country are different in term of size