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..



write a C programme to print all the strong numbers below 10000....

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

More Electronics Communications Interview Questions

Plot the pixel histogram( take any image) – count of values versus pixel intensity 0 to 255. You must write this from first principles – do not use the MATLAB hist command (although you may use it for comparison and checking your algorithm’s correctness). Plot the cumulative histogram. Do not use the cumsum function in MATLAB (write your own function to achieve this).

0 Answers  


Explain what is an operational amplifier?

0 Answers  


how to wish if there will both sir and madam present? how to put acuriculam vitae when about to be confertable? tell me abut your state, city,and district? how to present our hobbies and interest? what is the anser of "you are nat selected"?

1 Answers   DMRC, HPCL, Infosys, NTPC, SSB, Wipro,


why 2 rectifier is used in smps?

4 Answers   Infosys, Syntel,


What are the disadvantages of bjt?

0 Answers  


IS THIS POSSIBLE TO VARY THE POWER BY VARYING THE FREQUENCY IN TANNER EDA TOOL..

0 Answers  


WHAT IS THE DIFFERENCE BETWEEN FIX32 & WINCC

0 Answers   TATA,


For asynchronous transmission, is it necessary to supply some synchronizing pulses additionally or to supply or to supply start and stop bit?

2 Answers   IBM, Wipro,


today software are down how u are u going to clear this?

0 Answers   HCL,


what do you mean by quasi fermi level?

1 Answers  


In TRx, What is the function of SDCCH, BCCH.

2 Answers   NSN,


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

0 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5086)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4456)
  • Electrical Engineering Interview Questions Electrical Engineering (16639)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)