write a program to check whether a given integer is a strong
number or not?
[Hint:
145=1!+4!+5!
=1+24+120
=145]

Answer Posted / nabanita dutta

#include<stdio.h>
#main()
{
int n,sum=0,r,f=1,i=1,m;
printf("enter anumber");
scanf("%d",&n);
m=n;
while(n>0)
{
r=n%10;
for(i=1,f=1;i<=r;i++)
f=f*i;
sum=sum+f;
n=n/10;
}
if(sum==m)
printf("the given number is strong number");
else
printf("the given number is not a strong number");
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a sequential access file?

644


What is data structure in c language?

597


What are linker error?

607


Explain what are bus errors, memory faults, and core dumps?

782


What is difference between array and pointer in c?

532






What is bash c?

550


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

607


How do I read the arrow keys? What about function keys?

606


What is a structural principle?

634


an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational

800


What are the application of c?

637


How can I find out if there are characters available for reading?

633


What is the purpose of void pointer?

590


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

2586


What is the use of #define preprocessor in c?

607