Cognizant Interview Question

Logic to check whether it is a armstrong number