Lessons
C++ · Storing Information · 10. Type Conversions

step 1 of 7

Save the half

total and count are both int, so 7 / 2 gives 3. Writing (double) in front turns a box into a decimal for a moment.

Mission

Put (double) before total so I print 3.5.

PIP·1
main.cppyour code
1
2
3
4
5
6
7
8
9
← press me!
readyscreen

Press RUN to see what this program does.

Do the mission and Next turns green.

Type Conversions