answersLogoWhite

0

Write a program to print Armstrong in c?

Updated: 8/17/2019
User Avatar

Wiki User

12y ago

Best Answer

void main()

{

int n,b=0,t;

clrscr();

printf("Enter the no");

scanf("%d",&n);

t=n;

while(n>0)

{

a=n%10;

b=b+a*a*a;

n=n/10;

}

if(b==t)

{

printf("Armstrong no");

}

else

{

printf("Not an Armstrong no");

}

getch();

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to print Armstrong in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp