Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / nabanita dutta

#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,f=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 ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are the different file extensions involved when programming in c?

1158


What is the difference between class and object in c?

1240


How was c created?

1093


What are the types of arrays in c?

1236


c program to compute AREA under integral

2466


What are pointers in C? Give an example where to illustrate their significance.

1272


What is extern c used for?

1119


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1088


how can use subset in c program and give more example

2047


Write a program to find factorial of a number using recursive function.

1178


Where is c used?

1154


What are global variables and how do you declare them?

1169


What is the use of function overloading in C?

1214


How do I get an accurate error status return from system on ms-dos?

1178


What is the difference between procedural and declarative language?

1188