Yes, they will trample me underfoot, the numbers marching one two three, four hundred million five hundred six, reducing me to specks of voiceless dust, just as, all in good time, they will trample my son who is not my son, and his son who will not be his, and his who will not be his, until the thousand and first generation, until a thousand and one midnights have bestowed their terrible gifts and a thousand and one children have died, because it is the privilege and the curse of midnight's children to be both masters and victims of their times, to forsake privacy and be sucked into the annihilating whirlpool of the multitudes, and to be unable to live or die in peace. (3.30.84)
The end of Midnight's Children is the scene of Saleem's death. He's crushed underfoot by a huge crowd and turned into dust. But he tells us that this is not the end. There will be more midnight's children, generations and generations of them, and they will all live the same way that he did.
The number of feet that trample Saleem is roughly equal to the population of India at the time, which makes sense since the whole novel is kind of about Saleem trying to figure out his identity while constantly being assaulted by the voices in his head and the history of Mother India. We guess that he didn't win this war, and he just becomes part of the overall Indian story.
Of course, we don't want to make you feel like we totally get the ending. There's a lot of weird stuff in there. For example, what's that weird thing about the midnight's children being masters and victims of their times? Does Saleem even really die? If he does, does he really turn into dust? There are a lot of questions, and we don't have answers.
Even though it's a weird ending, we get a bit of closure because we've been waiting for Saleem to die for the whole book. We didn't know how it would happen, but we knew that he was going to die from the first page. It's also nice to see that reference to 1001 Nights come back again, as if Scheherazade is still telling her stories. Finally, we get the prediction that the midnight's children are not really over. It's an ending for Saleem, but a new beginning for his son and the rest of Shiva's children. It kind of makes us want to read Midnight's Children Part Two.