0
How to make a program of Armstrong number??
3 Respuestas
+ 2
You can use
#include <iostream>
using namespace std;
int main() {
int n,n1,rem,num=0;
cout << "Please enter a digit " << endl;
cin >> n;
n1=n;
while(n1!=0)
{
rem=n1%10;
num+=rem*rem*rem;
n1/=10;
}
if(num==n)
cout << n << " is an Armstrong number";
else
cout << n << " is not an Armstrong number";
return 0;
}
+ 2
what?
0
i don't kown