Ask Question
20 December, 14:30

Declare a variable temperature and initialize it to 98.6. Instructor Notes: Note that "initialize" means "declare and assign a value in the same statement." ote that this exercise wants a single statement, not a complete program. What data type is appropriate for a value such as the value listed above?

+3
Answers (1)
  1. 20 December, 15:05
    0
    float temperature = 98.6; / /declaration and initialization of the variable

    Explanation:

    In the programming language, there are two types of data types for the decimal number that is float and double.

    Double data type is used when we require to print more than two decimal value and it also contains both integer type and decimal type value. Float data type is used when we required to print one or two decimal value, it only contains and print decimal value.

    So, we have to print one decimal value, that's why we use float data type.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Declare a variable temperature and initialize it to 98.6. Instructor Notes: Note that "initialize" means "declare and assign a value in the ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers