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

#include<stdio.h>
int fact(int r)
{
if(r=0 || r=1)
return 1;
else
return(r*fact(r-1);
}
void main()
{
int a,n,rem,sum=0
printf("Enter the number\n");
scanf("%d",&n);
a=n;
while(n!=0)
{
rem=n%10;
sum=sum+fact(rem);
n=n/10;
}
if(sum==a)
printf("%d is a strong number",a);
else
printf("%d is not a strong number",a);
}

Is This Answer Correct ?    8 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a constant and types of constants in c?

1140


What does struct node * mean?

1024


hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

2022


What is a newline escape sequence?

1106


What is include directive in c?

1163


what is the height of tree if leaf node is at level 3. please explain

2153


why wipro wase

2313


What is strcmp in c?

1128


What is the difference between malloc() and calloc() function in c language?

1084


What is the collection of communication lines and routers called?

1129


can we have joblib in a proc ?

2310


Find MAXIMUM of three distinct integers using a single C statement

1071


How do I use void main?

1092


int i=10; printf("%d %d %d", i, i=20, i);

1626


What is non linear data structure in c?

1033