Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Why 8051 is called as 8051 plz send ans at swatimehta5487@gmail.com

4 Answers  


d/f between windows 2000 and 2003 os

3 Answers   Windows, Wipro,


The effect of reheating is

0 Answers   HAL,


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

0 Answers  


What is meant by radix (or base) of a number system?

0 Answers  


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?

0 Answers  


why digital signals are preferred over analog in com?

7 Answers  


Why does sidebands vl come in case of analog modulation?

0 Answers  


what are software interrupts present in 8051 Microcontroller? Only Software interrupts//////

0 Answers  


Explain the differences between voltage and current controlled devices?

0 Answers  


(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?

6 Answers   CSC,


Categories
  • Civil Engineering Interview Questions Civil Engineering (5086)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4453)
  • Electrical Engineering Interview Questions Electrical Engineering (16638)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • 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)