Two bomb attacks in north-eastern Nigeria have left at least 42 people dead and more than 100 injured, officials say.