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

#include<iostream.h>
#include<conio.h>
int main()
{
int j,t,n,r,s=0,i,f=1;
clrscr();
for(j=3;j<=1000;j++)
{
s=0;
n=j;
while(n>0)
{
f=1;
r=n%10;
for(i=1;i<=r;i++)
{
f=f*i;
}
s=s+f;
n=n/10;
}
if(j==s)
{
cout<<j<<endl;
}
else
continue;
}
getch();
return 0;
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why header file is used in c?

1104


Explain how can type-insensitive macros be created?

1004


How do you convert strings to numbers in C?

1243


What's a good way to check for "close enough" floating-point equality?

1182


What does the characters “r” and “w” mean when writing programs that will make use of files?

1492


Can you subtract pointers from each other? Why would you?

973


I have seen function declarations that look like this

1058


What is the best organizational structure?

1135


What is a char c?

1055


Explain how do you determine the length of a string value that was stored in a variable?

1165


Can we change the value of #define in c?

1006


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1259


What does int main () mean?

1039


how to construct a simulator keeping the logical boolean gates in c

2270


Explain how can I avoid the abort, retry, fail messages?

1071