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 |
how to test on design and style in software?
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.
what is leadership
Can cassette ac indoor unit be put into window
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
Explain what is a latch?
An op-amp comparator circuit uses which of the following a. positive feedback b. negative feedback c. active feedback d. no feedback
6-WHAT IS THE IMPORTANCE OF VSWR IN TELECOM? DESCRIBE WITH EXAMPLE
What are the demerits of passive filters?
Explain the different steps of Commissioning.
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