# Check a givennumber is armstrong or not using c program

## Check a given number is armstrong or not using c program

This page has a Check a given number is armstrong or not using c programThe Armstrong number is an integer number. The Armstrong is also called as Narcissistic or Pluperfect digital invariant. The n-digits Armstrong number will be equal to the sum of nth power of all digits of the n-digits number. For Example . . . 153 and 1634 are Armstrong numbers. That is, 1*1*1*+5*5*5+3*3*3 = 153,  1*1*1*1+6*6*6*6+3*3*3*3+4*4*4*4=1634 are Armstrong numbers. The below given C program is used to Check a given number is armstrong or not using while statements. Kindly check out the program to Check a given number is armstrong or not.

## How will ask to check a number is Armstrong or not in C

The Armstrong or not checking program can be asked in many ways as  1). Find out the Armstrong number using C program 2). C program to verify whether the given number is Armstrong or not  3). C program to find whether the given number is Armstrong or not  4). C Program to check whether number is Armstrong or not  5). C Program to check whether a number is Armstrong or not  6). C program to check a given number is Armstrong number or not  7). C Program to find entered number is Armstrong number or not  8). Program to find Armstrong or not   9). Program to find Armstrong numbers   10). Program to find a given number is Armstrong or not   11). Program to find a number is Armstrong or not   12). C program to check a number is Armstrong or not.

### Program to check an Armstrong number

#include<stdio.h>
int main(){
int numb,rem,sum=0,entr,nr,i,m=1,digits=0;
int initial,final;
clrscr();
printf("\n Give any Integer number: \n");

scanf("%d",&numb);
entr = numb;
nr=numb;
while(nr>0){
nr = nr / 10;
digits +=1;
}
nr=numb;
while(nr!=0){
rem = nr % 10;
nr = nr / 10;
for(i=1;i<=digits;i++){
m = m*rem;
}
sum +=m;
m=1;
}
if(sum == entr)
printf("\n The given Number  %d is Armstrong ",entr);

else

printf("\n The given Number  %d is not Armstrong Number",entr);
return 0;
}

Sample output:

Give any Integer number:  153

The given Number  153  is Armstrong

Give any Integer number:  5674

The given Number  5674  is not Armstrong Number

## Most Related Armstrong or not Programs in C

About Er. T.Tharesh Kumar

I am a Professor and Head of Department of Computer Science in an Arts and Science College. I have designed this website to provide solved example programs of different categories for all the school and college going students to learn C language deeply, and to practice Interview based Multiple Choice (Objective Type) questions and answers.

## Armstrong numbers can be checkd by C program

The Armstrong is an integer number, and it has no decimal point. It is clear that, the n-digits Armstrong number must be equal to the sum of nth power of all digits of the n-digits number. For Example . . .  the integer numbers such as 153 and 1634 are Armstrong numbers. The Armstrong numbers can be checkd as 1*1*1 + 5*5*5 + 3*3*3 = 153,  1*1*1*1 + 6*6*6*6 + 3*3*3*3 + 4*4*4*4 = 1634. The Armstrong numbers can be checkd by the above C program.