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 is d'n in c?

1067


What is meant by type specifiers?

1079


What is the difference between test design and test case design?

2025


What are bitwise shift operators in c programming?

1036


What is ambagious result in C? explain with an example.

2550


Explain what is a program flowchart and explain how does it help in writing a program?

1040


Explain how can I convert a string to a number?

1023


What are the two types of structure?

1037


What are preprocessor directives in c?

1031


What is your stream meaning?

1120


Where static variables are stored in memory in c?

945


What is the difference between ++a and a++?

1147


What is abstract data structure in c?

970


Explain high-order and low-order bytes.

1046


What is conio h in c?

1000