answersLogoWhite

0

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

#include

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

#include

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

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

JordanJordan
Looking for a career mentor? I've seen my fair share of shake-ups.
Chat with Jordan
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve

Add your answer:

Earn +20 pts
Q: What is strong number n Armstrong number in C language?
Write your answer...
Submit
Still have questions?
magnify glass
imp