The correct option is A 9
There were all sparrows but six means that six birds were not sparrows but only pigeons and ducks.
Similarly, number of sparrows + number of ducks =6 and number of sparrows + number of pigeons =6.
This is possible when there are 3 sparrows, 3 pigeons and 3 ducks i.e. 9 birds in all.