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 |
newspaper is reusable one or not? renewable one means what is the reason?
why sometimes PF value have an negative sign?
whah is active and passive components?
Why is the grid in a cro provided with a hole in it?
why we are using input resistance in op-amp. indicate the role of it.
Define what do you understand by reverse saturation current of a diode?
How can a thyristor turned off?
Why 50Hz power supply is standard?
Can we get light when the circuit is working?
what is limitation of auto transformer?
What is the effect of temperature on the reverse saturation current of a diode?
in govt polytechnic lecturers tell me what is the expected cut off for ece after the interview list announced