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

WHY FM IS NOT USED FOR VIDEO SIGNALS

6 Answers   BEL,


Pease send Quantitative Quantitative Aptitude Question

0 Answers   Indian Overseas Bank,


Which type of architecture 8085 has?

3 Answers  


hi.i want to get cleared about ece and want to know what are the topics or chapters which were in 11 and 12 grade.esp., in maths and physics?ans me soon.i am fresher.

0 Answers  


we are operation 3 generator with module 5510 and electronic control module . two generator running system healthy and generator called another one generator running always generator called did not showing system healthy

0 Answers  






snd me karur vysya bank clerk model papers kundavarapu.harish90@gmail.com

0 Answers  


Hi..Iam going to give Junior Engineer exam og Railway mumbai I wanted to kow where i will get study stuff and GK books? Plz its urgent

1 Answers  


What is meant by saying at what current is transistor biased?

0 Answers  


What is WPS?

0 Answers  


What is capacitor and its function?

7 Answers  


IN AN OSCILLOSCOPE TWO COUPLING IS THERE, THAT IS AC & DC COUPLING, WHERE DO WE USE THESE COUPLINGS ?

2 Answers   DRDO, VH,


What is the main drawback of a dual slope adc?

0 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16632)
  • 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)