Markets end flat\, TCS 2% down ahead of earnings outcome