Jan 11, 2012

C Program to find the strong number.

Write a C Program to find the given number is strong or not?
A number is called strong number if sum of the factorial of its digit is equal to number itself.
Example: 145 since 1! + 4! + 5! = 1 + 24 + 120 = 145.
Read more about C Programming Language .

/***********************************************************
* You can use all the programs on  www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact info@c-program-example.com
* To find more C programs, do visit www.c-program-example.com
* and browse!
* 
*                      Happy Coding
***********************************************************/
#include<stdio.h>
#include<conio.h>

int main()
{
 int num,i,f,r,sum=0,num1;
 clrscr();
 printf("Enter a number: ");
 scanf("%d",&num);

 num1=num;
 while(num){
  i=1,f=1;
  r=num%10;

  while(i<=r){
   f=f*i;
   i++;
  }
  sum=sum+f;
  num=num/10;

 }
 if(sum==num1)
  printf("%d is a strong number",num1);
 else
  printf("%d is not a strong number",num1);
 getch();
 return 0;

}
Read more Similar C Programs
Learn C Programming

Number System

You can easily select the code by double clicking on the code area above.

To get regular updates on new C programs, you can

You can discuss these programs on our Facebook Page. Start a discussion right now,

our page!

Share this program with your Facebook friends now! by liking it


(you can send this program to your friend using this button)

Like to get updates right inside your feed reader? Grab our feed!

To browse more C Programs visit this link