by Dinesh Thakur Category: C Programming (Pratical)

In This program user ask to find out the number is Armstrong or not. “A number is Armstrong if the sum of cubes of individual digits of a number is equal to the number itself”. User declares required variables for this operation. User uses a temp variable that will use to store the value for temporary time period. Declaring while condition while (num>0) user ask to cub=num%10, num=num/10, sum=sum+ (cub*cub*cub).

Then a if-else condition if(temp==sum) then the number is Armstrong else it will not. And after creating all instance in the end display result on the screen as output.

Problem statement:

This is C program to Check out the Number is Armstrong or not.

  1. Declaring the variables.
  2. Using while condition along with control statements.
  3. Display result on the Screen.

Here is C source code for checking out the number is Armstrong or not. The output of this program shown below. 


void main()
   int num,temp,cub,sum=0;
   printf("Enter a Number : ");
              printf("Number is Armstrong");
              printf("Number is not Armstrong");
Output :

Write a  Program for  Number is Armstrong Number  

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.