Suppose there are B books and T tables
If he puts 9 books on each table he will have two tables left vacant.
B = 9(T-2)
If he put 6 books on each table he will have 3 books left over .Find the numbers of books
6T+3 = B
6T+3 = 9(T-2)
6T+3 = 9T-18
21 = 3T
7 = T
6T+3 = 6(7)+3 = 42+3 = 45 = B
So there are 7 tables and 45 books.
Checking: Putting 9 books on 5 tables takes all 45 books,
and there will be 7-5 = 2 tables with no books.
Putting 6 books on all 7 tables takes 42 books,
and there will be 45-42 = 3 books left over.
Edwin