write a C programme to print all the strong numbers below 10000..



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

Post New Answer

More Electronics Communications Interview Questions

how to test on design and style in software?

0 Answers  


which are the standards followed in high temperature Electronics?

0 Answers   General Motors GM, Secure Meters,


i am btch 4th semester ece student.i want to get idea 6th month indistrial tranning and job in tcs.

0 Answers   TCS,


what is leadership

3 Answers  


Can cassette ac indoor unit be put into window

0 Answers  






hi all iam going to give AAI tech exam i did my BE in electronics and communication if any one have any sample papers and SYLLABUS for it please plzzzzzzzzzzzzz for my career mail me at neha_sheokand11@yahoo.co.in

0 Answers  


Explain what is a latch?

0 Answers  


An op-amp comparator circuit uses which of the following a. positive feedback b. negative feedback c. active feedback d. no feedback

4 Answers  


6-WHAT IS THE IMPORTANCE OF VSWR IN TELECOM? DESCRIBE WITH EXAMPLE

1 Answers  


What are the demerits of passive filters?

0 Answers  


Explain the different steps of Commissioning.

0 Answers   NSN,


In order to handle all combinations of input voltage polarities, a multiplier must have A Four-quadrant capability B Three- quadrant capability C Four inputs D Dual-supply voltages

0 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5084)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16631)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1094)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)