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

#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;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 ?    27 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the uses of null pointers?

1132


how is the examination pattern?

2029


Can we change the value of static variable in c?

1036


In c language can we compile a program without main() function?

1145


What is zero based addressing?

1184


Here is a good puzzle: how do you write a program which produces its own source code as output?

1114


Can you think of a logic behind the game minesweeper.

2474


Why is c called c not d or e?

1105


What is the difference between near, far and huge pointers?

1105


What are directives in c?

980


What is a structural principle?

1177


What does int main () mean?

1038


Explain how does flowchart help in writing a program?

1127


i got 75% in all semester am i eligible for your company

2232


How to write a code for reverse of string without using string functions?

2155