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 / giridhar
#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;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 ? | 27 Yes | 11 No |
Post New Answer View All Answers
What is d'n in c?
What is meant by type specifiers?
What is the difference between test design and test case design?
What are bitwise shift operators in c programming?
What is ambagious result in C? explain with an example.
Explain what is a program flowchart and explain how does it help in writing a program?
Explain how can I convert a string to a number?
What are the two types of structure?
What are preprocessor directives in c?
What is your stream meaning?
Where static variables are stored in memory in c?
What is the difference between ++a and a++?
What is abstract data structure in c?
Explain high-order and low-order bytes.
What is conio h in c?