2:10 PM
C++ Program of ARMSTRONG NUMBER

Write a Program to show ARMSTRONG NUMBER.

#include<iostream.h>
#include<conio.h>
void main()
{
int num,r,sum=0,temp;
clrscr();
printf("\nEnter a number:-");
scanf("%d",&num);
temp=num;
while(num!=0)
{
r=num%10;
num=num/10;
sum=sum+(r*r*r);
}
if(sum==temp)
printf("\nThe number %d is an armstrong number",temp);
else
printf("\nThe number %d is not an armstrong number",temp);
getch();
}
 
Note:    
           If you want to change in this program please write through the comment on this page. you can also past similar program of 
             c++ with output.your comment is valuable to the other user and person.
Views: 119 | Added by: vijoriya | Tags: Number, c++, program, Armstrong | Rating: 0.0/0
Total comments: 0
avatar