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

What are dangling pointers in c?

1155


What is the difference between int main and void main in c?

1118


What are reserved words with a programming language?

1086


How variables are declared in c?

1009


How do I copy files?

1014


Explain what are multidimensional arrays?

1019


What is the meaning of 2d in c?

1078


What is a list in c?

994


Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.

1064


What is pointers in c?

1081


1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.

2770


Which is better pointer or array?

993


How will you find a duplicate number in a array without negating the nos ?

2103


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

1759


Differentiate between new and malloc(), delete and free() ?

1150