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 |
WHY FM IS NOT USED FOR VIDEO SIGNALS
Pease send Quantitative Quantitative Aptitude Question
0 Answers Indian Overseas Bank,
Which type of architecture 8085 has?
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.
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
snd me karur vysya bank clerk model papers kundavarapu.harish90@gmail.com
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
What is meant by saying at what current is transistor biased?
What is WPS?
What is capacitor and its function?
IN AN OSCILLOSCOPE TWO COUPLING IS THERE, THAT IS AC & DC COUPLING, WHERE DO WE USE THESE COUPLINGS ?
What is the main drawback of a dual slope adc?