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

How pointer is different from array?

1017


How are variables declared in c?

1027


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

1146


cavium networks written test pattern ..

4026


What should malloc(0) do?

1058


Why functions are used in c?

1070


What are variables and it what way is it different from constants?

1191


How can I remove the leading spaces from a string?

1096


What is the difference between null pointer and wild pointer?

1135


the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?

945


Can a pointer point to null?

1021


How can I recover the file name given an open stream or file descriptor?

1029


What are the different types of C instructions?

1244


Whats s or c mean?

949


Explain what is the difference between #include and #include 'file' ?

968