answersLogoWhite

0

Strong number program using c

Updated: 12/15/2022
User Avatar

Wiki User

14y ago

Best Answer

Nikhil Aggarwal

strong_number: The sum of factorials of digits of a number is equal to the original number.

void strong_number()
{
int num,i,p,r,sum=0,save_num;
printf("\nEnter a number");
scanf("%d",&num);
save_num=num;
while(num)
{
i=1,p=1;
r=num%10;
while(i<=r)
{
p=p*i;
i++;
} //while
sum=sum+p;
num=num/10;
} //while
if(sum==save_num)
printf("%d is a Strong number", save_num);
else
printf("%d is not a Strong number", save_num);
}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Strong number program using c
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a c program to convert binary to decimal by using while statement?

write a c++ program to convert binary number to decimal number by using while statement


Write a program that read phrase and print the number of lower-case letter in it using function of counting?

write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program


Write a program By using if else statement to read a number and check whether it is positive or negative?

write a c++program by using if statement to read a number and check whether it is positive or negative


C program for comparison of dates using structures?

C program for comparison of dates using structures


You want to write a simple without using pointer or array c program which will print greatest number when you give 20 number?

i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?


How do you write a C program to check whether the number is odd or even Ps-using DEV complier?

To write a C program to determine if something is odd or even you need to be a programmer. To write a program in C is complicate and only done by programmers.


Write Client and server program in C language using UDP?

Write and run a client and a server program in C-language using UDP


Write a c program Fibonacci series using for loop in java?

Exactly what do you mean by 'C program in Java'


Write a c program to find the greatest number of from three number using switch?

Oh, well, simply: max = (a + b + c * 2 + abs(a - b) + abs(a + b - c * 2 + abs(a - b))) / 4;


Is c an application or software?

"C" is a programming language. It is implemented by writing a program using the C syntax and then translated by a compiler, which is an application program.


How do you extend to another c program using a superclass?

C does not support superclassing. Try C++.


Program that is executed in c but not in c?

Answer1. When you save file using extension ".c" the program executes using "C" compiler and it cannot execute any other program which is not in "C".So, we cannot execute program in "C" which is not in "C".2. When you save file using extension ".cpp" the program executes using "C++" compiler and it can execute program of "C" but it should be saved with extension ".cpp".So, There is a program which is not in "C++" can be executed in "C++" compiler.Another answerYour question is ambiguous. 1. Okay in C++ but not in C:int main (void){ cout