What is strong number n Armstrong number in C language?

already exists.

Would you like to merge this question into it?

already exists as an alternate of this question.

Would you like to make it the primary and merge this question into it?

exists and is an alternate of .

Strong number:-
The sum of the factorials of digits of a number is equal to the original number.
Ex: n=145=> 1! + 4! + 5! = 1 + 24 + 120 = 145
so it is strong number.




Armstrong number:-

The sum of the cubes of digits of a number is equal to the original number.
Ex: n=153 => 13 + 53 +33 = 1+125+27= 153
so 153 is arm strong number.




C program for strong numbers
#include<stdio.h>
#include<conio.h>
void main()
{
int sof=0,n,dn,ctr,prod,rem;
printf("Enter the number\n");
scanf("%d",&n);
dn=n;
while(n!=0)
{
prod=1,ctr=1;
rem=n%10;
while(ctr<=rem)
{
prod=prod*ctr;
ctr=ctr+1;
}
sof=sof+prod;
n=n/10;
}
if(sof==dn)
{
printf("The number entered is strong number");
}
else
{
printf("The number entered is not a strong number");
}
}

C program for amstrong numbers
#include<stdio.h>
#include<conio.h>
void main()
{
int dn,rem,sum,n;
printf("Enter the number:");
scanf("%d",&n);
for(dn=n,sum=0;n!=0;rem=n%10,sum=sum+rem*rem*rem,n=n/10);
if(dn==sum)
printf("Amstrong number");
else
printf("Not a amstrong number");
}


By Nagarjuna ECE
sri indu,
IBP
7 people found this useful

Write a Program to find the fibonnacci series of n numbers in C language?

include. include. void fibo(int);. void main(). {. int num;. clrscr();. printf("\n\t Enter number of elements in series : ");. scanf("%d",&num);. if(num>0). fibo(num

What is a strong number?

As to your question I'm a bit puzzled. 2 is larger than 1 and 20 is more than 10 but less than 30. Alright, so you already know this much I'm assuming your question may relate

Strong number program using c?

Nikhil Aggarwal strong_number: The sum of factorials of digits of a number is equal to the original number. void strong_number() { int num,i,p,r,sum=0,save_num; printf("\nEn

What is strong number in C language?

Strong number is a number for which sum of factorials of the digits is equal to the given number. Eg: let us consider 145 where sum of factorials of the digits= 1!+4!+5!=1+2

Write a c plus plus program to check a number is Armstrong number?

include #include // for std::pow() unsigned int get_length(unsigned int num,const unsigned int base=10) { unsigned int len=1; while(num && (num/=base)) ++len; return( le

C program to find Armstrong number using for loop?

To find Armstrong numbers using a for loop, the loop simply generates decimal numbers in a given range and tests each of them to see if they are Armstrong numbers in a given b

Program in c to find whether number is a Armstrong or strong number?

include #include void main() { int number, sum = 0, rem = 0, cube = 0,temp; printf ("enter a number"); scanf("%d", &number); temp = number; while (number != 0)
In Math and Arithmetic

How do you write the average n numbers program in c language?

Write your program and if you are having a problem post it here with a description of the problem you are having. What you are asking is for someone to do your homework for
In C++ Programming

What is programme in c plus plus of a Armstrong number?

include #include // for std::pow() unsigned int get_length(unsigned int num,const unsigned int base=10) { unsigned int len=1; while(num && (num/=base)) ++len; return( le