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

#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 ?    7 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of void pointer and null pointer in c language?

1127


When would you use a pointer to a function?

1055


When should a far pointer be used?

1140


What is a null pointer in c?

1240


Explain how do you use a pointer to a function?

1116


With the help of using classes, write a program to add two numbers.

1044


illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question

2076


How many bytes are occupied by near, far and huge pointers (dos)?

1163


Explain what is a pragma?

1053


What are extern variables in c?

996


What is the use of f in c?

985


find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2

1996


What is c variable?

1050


program for reversing a selected line word by word when multiple lines are given without using strrev

2487


Explain what is the best way to comment out a section of code that contains comments?

1143