write a C programme to print all the strong numbers below 10000..
Answer Posted / 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 View All Answers
Which device produces voltage variable capacitor? How the voltage variable capacitance varies with the change in voltage across it?
10. What are the different data rates in Abis for Traffic, TRX signaling and OMU
How is sio2 layer formed in a monolithic ic?
What is the gauss`s law?
Please send me the sample pattern for the Electronics and communication for the post in RRB s&T to my Email ID : sivamec6034@gmail.com
What is an excess-3 code?
i m selected in AAI JE. my interview is on 25 sept. 2010. i don't hv any idea abt aai interview. can anyone help me, i want to know interview qus of aai. so pls help me... my e-mail id -- mailmanish_kumar@yahoo.co.in
What is the difference between application of dc current and application of ac current to an electronic circuit. what are the changes it causes.
what is asynchronous data transfer???
Pls tell me when will coming ssc scientist assistant result...how many marks for elgilibity.. Am a minority girl oc
Tell me how many mosfet switches are there in dynamic ram?
In explain what way is the voltage follower a special case of the non-inverting amplifier?
also send me aptitude question paper
Difference between mobile and a cell phone.
How is cad used with electronics?