Mphasis Interview Question

Asked to write code for Armstrong number