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 8051 is called as 8051 plz send ans at swatimehta5487@gmail.com
d/f between windows 2000 and 2003 os
The effect of reheating is
write down a program to that reads the data from port 02H, count the number of 1's in the data and display the count on port 03H in 8085 microprocessor
What is meant by radix (or base) of a number system?
i cleared the written xam. for the post of atc now what i am going to prepare for the interview plz.guide me i dnt wanna loose this organisation bcoz its my dream company
0 Answers AAI Airports Authority Of India,
What is the difference between power diode and signal diode?
why digital signals are preferred over analog in com?
Why does sidebands vl come in case of analog modulation?
what are software interrupts present in 8051 Microcontroller? Only Software interrupts//////
Explain the differences between voltage and current controlled devices?
(i)Four friends are given named Akansha, Anuska, Anisha, ... , . Each of them live in a separate home and sleep on one bed. Akansha and Anuska have two extra beds, two of the house have green lawns while the rest have narrow porchs, One of the house has Airconditioner while the rest have fans. And so on.. Based on these informations five questions were asked like What is the total no of beds in all houses? Who lives in the house with green lawn and with AC?
Civil Engineering (5086)
Mechanical Engineering (4453)
Electrical Engineering (16638)
Electronics Communications (3918)
Chemical Engineering (1095)
Aeronautical Engineering (239)
Bio Engineering (96)
Metallurgy (361)
Industrial Engineering (259)
Instrumentation (3014)
Automobile Engineering (332)
Mechatronics Engineering (97)
Marine Engineering (124)
Power Plant Engineering (172)
Textile Engineering (575)
Production Engineering (25)
Satellite Systems Engineering (106)
Engineering AllOther (1379)