Cognizant interview question

Write a code to check Armstrong number