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 |
what is difference between feedback oscillator & relaxation oscillator?
Which is more dangerous AC current or DC current and why?
Why should you chosen this job
What is fm.
What is the function of Bias Tee (BPxx) input Which power supply card required for Ultra BTS for DC 24V input What is the state if the GREEN LED is glowing on PWSx card
what is TRANSDUCERS?
By referring to the barkhausen criterion and conventional circuit's analysis,show that for the Wein Bridge oscillator to oscillate,the voltage gain (Av) of the op amp must be set to 3 and the feedback ratio must be 1/Av.. Anyone, please help me!
How to know the Signaling Link Utilization for a MTP3B link which carries RANAP?
what is the role u want in my company and why?
what is difference b/w watt loss and watt full devices. what is watt loss and watt full devices?
What is sampling theorem?
How WDM works in wireless system...as we say that it works in optical and signals transmitted in this are light signals...??
Civil Engineering (5086)
Mechanical Engineering (4456)
Electrical Engineering (16639)
Electronics Communications (3918)
Chemical Engineering (1095)
Aeronautical Engineering (239)
Bio Engineering (96)
Metallurgy (361)
Industrial Engineering (259)
Instrumentation (3014)
Automobile Engineering (332)
Mechatronics Engineering (97)
Marine Engineering (124)
Power Plant Engineering (172)
Textile Engineering (575)
Production Engineering (25)
Satellite Systems Engineering (106)
Engineering AllOther (1379)