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

void main()
{
int n,f=1,rem,x,res=0,i;
clrscr();
printf("enter a number");
scanf("%d",&n);
x=n;
for(;n>0;n=n/10)
{
rem=n%10;
f=1;
for(i=1;i<=rem;i++)
f=f*i;
res=res+f;
}
if(res==x)
printf("given number is a strong number");
else
printf("given number is not a strong number");
getch();
}

Is This Answer Correct ?    18 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks

1096


When is a void pointer used?

1238


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

1250


Write a program for Overriding.

1157


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

1111


Explain how can I manipulate strings of multibyte characters?

1203


What are different types of variables in c?

1068


What is pointer to pointer in c language?

1141


How can I recover the file name given an open stream or file descriptor?

1078


How can I access an I o board directly?

1089


what do you mean by enumeration constant?

1011


Not all reserved words are written in lowercase. TRUE or FALSE?

1231


What is return type in c?

1131


Explain what is the difference between null and nul?

1149


hi any body pls give me company name interview conduct "c" language only

2280