What is the output of the expression 7/2
Answers
Answered by
0
Answer:
3.50
Explanation:
pls mark me brainliest
Answered by
0
The output of the expression that a variable holds depends on the datatype of the variable in any programming language.
Detailed Explanation:
- If the variable declared as float data type and stores the value(7/2) then the output will be 3.50. The decimal numbers is stored in float datatype.
- If the variable declared as integer data type and stores the value(7/2) then the output will be 3. The integer datatype can only be used to store the integer part, so it ignored the decimal points and give the answer by approximating the value.
- Furthermore, If the variable declared as double data type and stores the value(7/2) then the output will be 3.50.
- Decimal values can also be stored in double data type just like float datatype but the only difference is, the high precision of double datatype.
Similar questions