Armstrong Number

#include<stdio.h>
#include<math.h>
void main(){
	int num,temp,sum=0;
	printf("Enter any number:\n");
	scanf("%d",&num);
	for(temp=num;temp>0;temp/=10){
		sum+=pow(temp%10,3);
	}
	if(num==sum){
		printf("The number is Armstrong.\n");
	}else{
		printf("The number is not Armstrong.\n");
	}
}
Advertisements