Ask Question

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?

+4
Answers (1)
  1. 24 February, 06:52
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers