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

Im Simil,doing 6th semester Electronics & Communication Engineering.After completing my course I would like to be an integral part of Siemens technology.For dat when & how shoult I apply?

2229


what are the various modes of data transfer in 8085?

2112


What is pin diode?

1301


What is the effect of temperature on extrinsic semiconductor?

1130


How to call the "Procedure" in test bench for VHDL...? Please post the answer for it....?

2259


Which questions ask for ccna certified candidates

1533


1 explain advantage and dis advantages of FIR filters compared to IIRcouterparts ? 2 what is the need of filtering,ideal response of filters and actual response of filters ? 3 what is CMRR ? 4 which semiconductor device is used ad a voltage regulator and why ? 5 how can we rectify race around condition ?

2066


What is zigbee?

1235


12. Multiprogramming nd multithreading.. Which of these are better? a.multiprogramming b.multithreading c.depends on the system d.both are efficient

4525


What are the applications of dc chopper?

1181


3. What is the command to unlock the BTS

2229


Define what is a high-pass filter?

1054


What is meant by soa?

1181


What losses occur in a thyristor during working conditions?

1327


Define why are active filters preferred

1147