Science, asked by jkjackal8701, 1 year ago

Difference between data types and modifiers

Answers

Answered by ayaankhurana
0
Character : Character data type is used to store a character. A variable of character data type allocated only one byte of memory and can store only one character. Keyword char is used to declare variables of type character. Range of character(char) data type is -128 to 127.
For Example: char ch = 'A';
Integer : Integer data type is used to store a value of numeric type. Keyword int is used to declare variables of integer type. Memory size of a variable of integer data type is dependent on Operating System.For example size of an integer data type in a 32 bit computer is 4 bytes whereas size of integer data type in 16 bit computer is 2 bytes.
For Example: int count = 10;
Float : Floating point data type is used to store a value of decimal values. Memory size of a variable of floating point data type is dependent on Operating System. Keyword float is used to declare variables of floating data type. For example size of an floating point data type in a 16 bit computer is 4 bytes.
For Example: float rate = 5.6;
Double : Double data type is similar to floating data type except it provides up-to ten digit of precision and occupies eight bytes of memory. 
For Example: double d = 11676.2435676542;
Similar questions