Hi I would like to know if there is any way to obtain a float result from a division between two integers other than using "from __future__ import division"?
I am not looking for the .0 'trick'. Example 4/5.0 = 0.8.
I want to be able to do 4/5 = 0.8.
Thanks.
Hi, can you help me:
Which of the following options is a correct C++ instruction to calculate the number of containers filled with milk
that can be sold?
1. nrContainers = totalLitres - litresLeftOver;
2. nrContainers /= 5;
3. nrContainers = totalLitres / 5;
4. nrContainers = totalLitres % 5;
5. nrContainers = litresLeftOver * 5;
Question 2
Which of the following options is a correct C++ instruction to calculate the number of litres that will be left over?
1. litresLeftOver = totalLitres - nrContainers;
2. litresLeftOver /= 5;
3. litresLeftOver = totalLitres / 5;
4. litresLeftOver = totalLitres % 5;
5. litresLeftOver = nrContainers * 5;