Can I publish a book and the source code in the book under two different licenses?
Eg. Publish a book under the GNU FDL license, but license the source code examples in this book under the Apache license?
As long as you own the copyright to the works, you can even publish the source code itself under two different licenses, which can be radically different. For example, MySQL is licensed under both a commercial and an open-source license.
Given that you can publish a single piece of work as multiple licenses, it is your choice which one you wish to grant to the book or the code, as long as you own the copyright.