Menu


.

Write a program to know Automorphic number between certain range.

#include< iostream.h >

#include< conio.h >

void main()

{

clrscr();

int a,p,j,e,b,i,r,k,l=0;

cout<<"Enter any range";

cin>>a>>b;

cout<<"Armstrong nos are"<<endl;

for(i=a;i<=b;i++)

{

for(k=a;k!=0;k=k/10)

{

l++;

}

p=0;

for(j=i;j!=0;i=j/10)

{

r=j%10;

e=pow(r,l);

p=p+e;

}

if(p==i)

cout<<i<<endl;

}

getch();

}




Enjoy our courses Today