# C program to find whether the number is Armstrong number or not.

Posted by Mangesh on March 16, 2018

## Description :

A number is said to be Armstrong number, if sum of the cubes of its digits is equal to the number itself.
Example: 153 = 1*1*1 + 5*5*5 + 3*3*3 = 1 + 125 + 27.

## Logic :

We can divide the number by 10 and get the remainder, the remainder here is also the right hand side digit. then we can divide the quotient by 10 and get the next digit. we shall do this till we get 0 as quotient. we can multiply the digit thrice by itself to get it cube.

## Output :

` tested in Turbo C 3.2

Written with from Mangesh.

Related Post
1 C program to check whether given number is prime number or not.
2 C program for Fibonacci Series upto a limited ranges.
3 C program to find whether the number is Armstrong number or not.
4 C program to convert decimal number to octal number.
Latest Post
1 shubhanshu
2 test
3 C program for Breadth First Search.
4 C program for Depth First Search(DFS).
5 C for circular queue using linked list.