Can You Write A Program To Check Whether A Number Is Armstrong Or Not?

3

3 Answers

Alongbar Daimary Profile
#include<iostream.h>
#include<conio.h>
void main()
{
int Number,Temp,b=0;

cout<<"Enter any nuber to check";
cin>>Number;
Temp=Number;
int P;
while(Temp>0)
{
P=Temp%10;
b=b+P*P*P;
Temp=Temp/10;
}
if(b==Number)
{
cout<<"Armstrong no";
}
else
{
cout<<"Not an armstrong no";
}
getch();
}
Anonymous Profile
Anonymous answered
#include
#include
void main()
{
clrscr();
void amg(int )
int a;
couta;
amg(a);
getch();
}
void amg(int b)
{
  int c,n,x=0;
  n=b;
  while(b>0)
  {
  c=b%10;
  x=x+(c*c*c);
  b=b/10;
  }
  if(x==b)
  cout
Anonymous Profile
Anonymous answered
Can you write a program to check a given number is palandrome or not

Answer Question

Anonymous