Now we know that how to convert number into binary.What if we want to store alphapet or some other special characters.What if we wanna store float value like 0.5
.If we want to store characters then first we have to convert the character to number.Like every number has binary every character has number value.so we can easily convert the character to binary.
Now the data types comes in.Have you ever asked why there is .mp3 at an end of the audio filename?Have you ever asked why there is .mp4 at an end of video filename? because of this issue we have faced with characers.since we can store only binary in memory, we have to tell the computer what type it is? Speaking of types we know various types of numbers .
there is more types each language offers us.
.If we want to store characters then first we have to convert the character to number.Like every number has binary every character has number value.so we can easily convert the character to binary.
character -> number -> binary
.Yeah there is a problem.we are storing 'A' into memory.'A' is 97.when retrieving that 'A' from memory we will get '97'.Now how do we know it is a character 'A' or number '97'.Because in binary we use same binary digits for '97' and 'A'.Now the data types comes in.Have you ever asked why there is .mp3 at an end of the audio filename?Have you ever asked why there is .mp4 at an end of video filename? because of this issue we have faced with characers.since we can store only binary in memory, we have to tell the computer what type it is? Speaking of types we know various types of numbers .
- Whole numbers
- Natural Numbers
- Integers
- Integer
- Float
- Characters
- String
- Integers
Integers are numbers There is positive, negative and zero. - Characters
a number also could be a character.but those are not actual numbers.just a representive format.alphabets, numbers and other special characters. - Float
Numbers with points example: 0.25
it also could be signed.
there is more types each language offers us.