what will the data type of the following variable? A=101
Answers
Answered by
1
The data type of the given variable A=101 is an integer (int) data type.
- Almost all statically typed programming languages have the following common data types:
- String: To store a collection of letters symbols or special characters, this is the most wider categorization and any letter or any sentence can be stored as a string
- Integer: This is used to store numbers without decimal values. These do have a range up to 2,147,483,647 in both negative as well as positive sides.
- Boolean: This data type is used to store boolean i.e. true or false values.
- Clearly, the best fit for A=101 will be Integer (int) data type
Answered by
1
A = 101 is of integer data type.
Since the value provided to the identifier is not quoted("). So it will be considered as an integer only.
Many of the programming languages do not allow the direct initialization as given in the question. It will require the pre-declaration of the variable with the data type specified before that.
But in this case, the value assigned is integer only.
Similar questions
Math,
1 month ago
Hindi,
1 month ago
Political Science,
3 months ago
Social Sciences,
3 months ago
English,
9 months ago