C Programs

Write a C Program which checks armstrong number?


/* C Program which checks armstrong number */
#include <stdio.h>
 int main() {
        int n,num,rem, sum = 0;
        printf("Enter The Number : ");
        scanf("%d",&num);
        n=num;
        while(num > 0 ){
              rem = num % 10;
              sum = sum+rem*rem*rem;
              num = num/10;
        }
        if(sum == n){
            printf("It is Arm Strong Number");
        }
        else{
            printf("It is Not Arm Strong Number");
        }
       printf("\n");
       getch();
       return 0;
}
www.000webhost.com