Computer Science, asked by Sharukh507, 3 months ago

write a c++ program to determine whether the given number is an Armstrong number?

please answer

Answers

Answered by varsha5160
2

Answer:

Let's see the C++ program to check Armstrong Number.

  • #include <iostream>
  • using namespace std;

int main()

{

  • int n,r,sum=0,temp;
  • cout<<"Enter the Number= ";
  • cin>>n;
  • temp=n;


Sharukh507: incomplete program ☹️
Answered by Anonymous
4

#include<iostream.h>

int main()

{

int n,rem,y,sum=0;

cout <<"input no. to check Armstrong or not ";

cin>>n;

y=n;

while(n!=0)

{

rem=n%10

sum= rem*rem*rem;

n=n/10;

}

if(sum==y)

{

cout<<"Armstrong no.";

}

else

{

cout<<"not ";

}

return 0;

}

Similar questions