+ 1
can someone please explain the different data types
2 Respostas
+ 3
I Will Try To Explain Data Types.
Data Types Basically Specifies What Type Of Value The Variable Should Hold.
In other Languages like C , it also Tell Compiler Where To Store it Such As in Memory or in CPU Register.
It also Specifies The Representation Of Value i.e, the the structure of the value to be Stored.
.
Now Comming To Various Data Types.
The Fundamental Data Types Are : Interger ,Float, Double ,Character/String.
These Data Types Represents Values Differently.
Integer are Represented in 4 bytes.
Float 8 byes.
Double 10 bytes (not sure about Proper values because it depends on plateform x86 x64 bit)
similarly Character takes 2 Bytes.
Now Question may Arise Why Different Data Types. Answer is Simple We actually want to process Data that in Real World Is Pesent In Different Forms , So are the different Data types.
Different Language Uses Different Key Words To Specify Data type for Example int i; in C lang Specifies Interger. Some Languages uses integer i; to specify Interger.
Hope U Got The Basic And Right Answer.
Thanks.
+ 1
int is integer =1
float is a floating poit number = 1,2
double is a double precision floating point number=1,23
char is a character="a"
string is a raw="hello world"
these are the most common data types