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 C programme to print all the strong numbers below 10000..

Answer Posted / shiv darshan

#include<stdio.h>
int main(){
int num,i,f,r,sum,temp;
int max;


printf("Enter maximum range: ");
scanf("%d",&max);

printf("Strong numbers in given range are: ");
for(num=1; num <= max; num++){
temp = num;
sum=0;

while(temp){
i=1;
f=1;
r=temp%10;

while(i<=r){
f=f*i;
i++;
}
sum=sum+f;
temp=temp/10;
}

if(sum==num)
printf("%d ",num);
}
return 0;
}


Definition of strong number:

A number is called strong number if sum of the factorial of its digit is equal to number itself. For example: 145 since
1! + 4! + 5! = 1 + 24 + 120 = 145

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which device produces voltage variable capacitor? How the voltage variable capacitance varies with the change in voltage across it?

1117


10. What are the different data rates in Abis for Traffic, TRX signaling and OMU

2168


How is sio2 layer formed in a monolithic ic?

1044


What is the gauss`s law?

1107


Please send me the sample pattern for the Electronics and communication for the post in RRB s&T to my Email ID : sivamec6034@gmail.com

2074


What is an excess-3 code?

1097


i m selected in AAI JE. my interview is on 25 sept. 2010. i don't hv any idea abt aai interview. can anyone help me, i want to know interview qus of aai. so pls help me... my e-mail id -- mailmanish_kumar@yahoo.co.in

2067


What is the difference between application of dc current and application of ac current to an electronic circuit. what are the changes it causes.

2113


what is asynchronous data transfer???

1781


Pls tell me when will coming ssc scientist assistant result...how many marks for elgilibity.. Am a minority girl oc

1390


Tell me how many mosfet switches are there in dynamic ram?

1062


In explain what way is the voltage follower a special case of the non-inverting amplifier?

1032


also send me aptitude question paper

1965


Difference between mobile and a cell phone.

1072


How is cad used with electronics?

1025