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


Please Help Members By Posting Answers For Below Questions

Explain how can I prevent another program from modifying part of a file that I am modifying?

642


what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9

1431


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

721


Without Computer networks, Computers will be half the use. Comment.

1878


What will the code below print when it is executed?   int x = 3, y = 4;         if (x = 4)                 y = 5;         else                 y = 2;         printf ("x=%d, y=%d ",x,y);

1359






What does the format %10.2 mean when included in a printf statement?

1091


Is exit(status) truly equivalent to returning the same status from main?

588


What is a dynamic array in c?

598


What is the difference between strcpy() and memcpy() function in c programming?

628


while initialization of array why we use a[][2] why not a[2][]...?

1869


What is a memory leak? How to avoid it?

578


What is the use of gets and puts?

605


Is that possible to store 32768 in an int data type variable?

693


Write a program to generate the Fibinocci Series

668


What is the difference between new and malloc functions?

581