Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Armstrong or Not Without Using Function in C++

<code>
//TO FIND THE GIVEN NUMBER IS AMSTRONG OR NOT  WITHOUT USING FUNCTION

#include<iostream.h>
#include<conio.h>
void main()
{
int num,result=0;
int a,rem;
clrscr();
cout<<"Enter a number:\n";
cin>>num;
a=num;
while( a != 0)
{
rem =a%10;
result =result + rem*rem*rem;
a= a/10;
}
if(num == result)
cout<<"Given number is an amstrong number.";
else
cout<<"Given number is not an amstrong number.";
getch();
}

</code>