That completely depends on the contract you sign with the publisher.
Ernest Hemingway wrote Bibliography books.
Ray Bradbury wrote science fiction books.
15
Andy McNab wrote a few non-fiction books but mostly fiction books focusing on his military background and using this as a main motive in his writings.
Becca Heddle has written 18 non-fiction books so far, and 3 fiction, for a variety of ages.
An adult audience. He wrote these books as adult fiction because he said "child books suck"
Isaac Asimov wrote or edited more than 500 books. He wrote fiction and nonfiction. While best known for his science fiction, he wrote poetry, riddles, science text books, nonfiction for children, Bible commentaries, Shakespeare commentaries, and histories.
sandra cisneros wrote fiction and poetry
Yes. He wrote two non-fiction books for adults, and one book for children.
also earned a reputation in the science-fiction world during the 1980s when he wrote a few books.
Barbara Smucker wrote children's historical fiction recounting historical events seen through the perspective of children and teenagers caught up in them. Some of her books are about children from the historical period dealt with in the book ("Underground to Canada"), while others are about modern-day children taken back in time ("Garth and the Mermaid"). She wrote mostly chapter-books, but also at least one picture book.
Asimov didn't write just in one genre, but his fiction was largely Science Fiction.