Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 703 Bytes

Task-5.md

File metadata and controls

19 lines (11 loc) · 703 Bytes

Practical One, Task Five

Casting Data Types

  • This exercise requires you to cast the result of an operation into a double
  • Declare and initialise two int variables, sum and count
  • Intialise them to 17 and 5 respectively
  • Next declare a double called doubleAverage and an int called intAverage

To learn how to cast, click here

This is what your program should look like:

image

  • Print out intAverage and doubleAverage

Now try reading in values for sum and count, from the user.