determination of armstrong number in c

[ad_1]

determination of armstrong number in c
#include
#include
void arm(int a);
int main()
{
	int a;
	printf("\t\t\tEnter a number\n\t\t\t ");
	scanf(
	arm (a);
	getch();
	return 0;
}
void arm(int a)
{
	int b,sum,remainder;
	b=a;
	while (a>0)
	{
		remainder=
		sum=sum+(remainder*remainder*remainder);
		a=(a-remainder)/10;
	}
	if (b==sum)
	{
		printf("\t\nIt is armstrong number\n");
	}
	else
	{
		printf("\n\tIt is not armstrong number\n");
	}
}

[ad_2]

Please follow and like us:
Content Protection by DMCA.com