New to C++

Hi All

1stly i'm new to C++ and i need to create a program that will calculate an average. It goes like this, a new school has been opened and it has 15 classrooms and the principal needs to divide a number of desks received from Dept of Education according to number of classrooms and whats left needs to sent back. So in my solution i have 5answers but not sure with one will have a right output

1.nrPerClass = nrDesks % 15;
2.nrPerClass = nrDesks / 15;
3.nrPerClass = nrLeft % 15;
4.nrPerClass / = 15;
5.nrPerClass = nrLeft / 15;

Thanks
Q1. If you have 15 classrooms and you receive 57 desks, how many desks go in each classroom and how many should be sent back?
Q2. How did you arrive at your answer (ie, what math formula did you use)?
Q3. Which of the above lines of C++ code implement that formula?
I dun get what you want to ask...can u at post some code on or try to explain things more details?
number of desks per classroom = number of desks/15 (assuming number of desks per classroom is int type)
number of remaining desks = number of desks%15 (again same assumption)
EXAMPLE:
number of desks=57, number of desks per classroom=57/15=3
remaining desks=57%15=12
Topic archived. No new replies allowed.