Choosing Data Types

The working days per month are given as an integer, therefore, we can declare a variable of type int to store their value. For both the earned money and the exchange rate of dollar to lev, we will receive a floating-point number, therefore, we will use double. As double is the data type with the higher scope, and the output should also be a floating-point number, we use double for the other variables that we create as well.

results matching ""

    No results matching ""