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

newspaper is reusable one or not? renewable one means what is the reason?

1 Answers   Honeywell,


why sometimes PF value have an negative sign?

0 Answers  


whah is active and passive components?

5 Answers   Hindalco,


Why is the grid in a cro provided with a hole in it?

0 Answers  


why we are using input resistance in op-amp. indicate the role of it.

1 Answers  






Define what do you understand by reverse saturation current of a diode?

0 Answers  


How can a thyristor turned off?

0 Answers  


Why 50Hz power supply is standard?

2 Answers  


Can we get light when the circuit is working?

0 Answers  


what is limitation of auto transformer?

0 Answers  


What is the effect of temperature on the reverse saturation current of a diode?

0 Answers  


in govt polytechnic lecturers tell me what is the expected cut off for ece after the interview list announced

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)