- This exercise requires you to cast the result of an operation into a
double
- Declare and initialise two
int
variables,sum
andcount
- Intialise them to 17 and 5 respectively
- Next declare a
double
calleddoubleAverage
and anint
calledintAverage
To learn how to cast, click here
This is what your program should look like:
- Print out
intAverage
anddoubleAverage
Now try reading in values for sum
and count
, from the user.