Friday 31 August 2012

Armstrong number in c++ | source code | cpp armstronh number program

How to write armstrong number program in c++ with source code.
Examples of armstrong number in c++.
How to write A Program for  Armstrong Number
class arm
{
int n;
public: arm();
void display();
};
void arm::arm()
{
cout<<"\n a=";
cin>>n;
}
void arm::display()
{
int sum=0,r;
int a=n;
while(n>0)
{
r=n%10;
n=n/10;
sum=sum+(r*r*r);
}
if(a==sum)
cout<<"armstrong";
else cout<<"not armstrong";
}
void main()
{
arm ob;
clrscr();
ob.display();
getch();
}
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: