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

int fact(int f)
{
if(f==1||f==0)
return 1;
else
return(f*fact(f-1));
}
main()
{
int n,i,j,s=0;
printf("enter the number");
scanf("%d",&n);
i=n;
while(n!=0)
{
j=n%10;
s=s+fact(j);
n=n/10;
}
if(i==s)
printf("strong number");
else
printf("not a strong number");
}

Is This Answer Correct ?    12 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is #include stdio h?

1117


in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures

1208


How can a program be made to print the line number where an error occurs?

1088


How will you write a code for accessing the length of an array without assigning it to another variable?

1046


what is the difference between class and unio?

2363


What is the most efficient way to store flag values?

1184


What is difference between array and pointer in c?

1085


What is the general form of a C program?

1025


What is c programming structure?

1194


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

1097


What does *p++ do? What does it point to?

1063


Is c weakly typed?

1021


What is the ANSI C Standard?

1269


Who is the founder of c language?

1164


What is structure packing in c?

1079