No products in the cart.

Write a program to check if …

CBSE, JEE, NEET, CUET

CBSE, JEE, NEET, CUET

Question Bank, Mock Tests, Exam Papers

NCERT Solutions, Sample Papers, Notes, Videos

Write a program to check if a given number is an Armstrong number or not
  • 1 answers

Sia ? 4 years, 2 months ago

num = int(input("Enter a number: "))  

sum = 0  

temp = num    

while temp > 0:  

   digit = temp % 10  

   sum += digit ** 3  

   temp //= 10    

if num == sum:  

   print(num,"is an Armstrong number")  

else:  

   print(num,"is not an Armstrong number")  

https://examin8.com Test

Related Questions

what is palindrone
  • 2 answers
Write a program for swapping two numbers?
  • 0 answers
Write a program for swapping two numbers
  • 1 answers
What is alu
  • 1 answers
Define packages
  • 0 answers

myCBSEguide App

myCBSEguide

Trusted by 1 Crore+ Students

Test Generator

Test Generator

Create papers online. It's FREE.

CUET Mock Tests

CUET Mock Tests

75,000+ questions to practice only on myCBSEguide app

Download myCBSEguide App