Cognizant posts higher 2nd-quarter profit