Armstrong Number in C

Arms .. between numbers.html
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
	int i,a,b,rem,org,arm=0;
	printf("(a,b) is the interval so enter the value of 'a' and 'b'");
	scanf("%d%d",&a,&b);
	printf("The armstrong number between %d and %d are:",a,b);
	for(i=a;i<=b;i++)
	{
	org=i;
	while(org!=0)
	{
		rem=org%10;
		arm=arm+pow(rem,3);
		org=org/10;
	}
	   if(arm==org)
     	{
	
	   printf("%d",arm);
        }
	}
	getch();
	return 0;
}

0 Comments