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 / rajesh kumar s
void main()
{
int n,t,f=1,s=0,num;
printf("enter the num \t:");
scanf("%d",&n);
num=n;
while(num)
{
t=num%10;
f=1;
while(t)
{
f=f*t;
t--;
}
s=s+f;
num=num/10;
}
if(n==s)
printf("%d is a strong number",n);
else
printf("%d is not a strong number",n);
}
Is This Answer Correct ? | 83 Yes | 17 No |
Post New Answer View All Answers
Explain high-order bytes.
What are the types of i/o functions?
In c programming language, how many parameters can be passed to a function ?
Write a program to print factorial of given number using recursion?
What is p in text message?
Explain what is the general form of a c program?
What is c language in simple words?
What is header file definition?
Explain what is the difference between functions abs() and fabs()?
What is the equivalent code of the following statement in WHILE LOOP format?
What is a stream in c programming?
Subtract Two Number Without Using Subtraction Operator
What are the disadvantages of external storage class?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
Why we use void main in c?