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
What is parallel data transfer process?
Define fbus protocol?
What is the output power of a BTS, in dbm &watts if trx=2+2+2... if trx=4+4+4..
What is step up cyclo-converter ?
What is the difference between a multiplexer and encoder? Also what is the between demultiplexer and decoder?
Draw the circuit of ce configurations using npn transistor.
1. How many TRXs are supported in Nokia Metrosite 2. What is the command to lock the TRX 3. What is the command to unlock the BTS 4. What is the command from BSC to check the alarm in BTS 5. What is the maximum transmit power of FlexiEdge BTS 6. When Abis link is down, name the alarm that is generated at BSC 7. Orange LED on RRI card is glowing – what is the indication? 8. How many E1s are supported by one E1 card in BTS 9. How many ways one can login to BIO card? 10. What are the different data rates in Abis for Traffic, TRX signaling and OMU 11. BCSU card in BSC can support how many TRXs? 12. What is the command to check list of sites that are down? 13. How many TRX are supported when we use one M2HA card in BTS? 14. Name the different types of power supply card in BTS and the output power of each card 15. Ater interface is between transcoder and MSC – True/False 16. SS7 signaling is used in Abis interface – True/False 17. FlexiEdge BTS has RRI card – True/False 18. From Transcoder to MSC, data rate for each call is 64Kbps – True/false 19. Name different types of TRXs which supports different GSM bands 20. ODU LED shows orange – what is the significance?
What are the active wastes in nuclear submarrine and how they disposed or dump?
What are the functions of base station system (bss)?
whats the new trend in ece...? why we are going for embedded..?
Name some of the current controlled (current driven) devices?
how to fall in love?
What are the applications of flip-flops?
Ripple as referred to in a rectifier circuit.
hi...i had completed B.E.in Electronics & Communication.i had applied Section Engineer in railway recruit ment 2012.I need previous year exam papers.