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 program to check whether a given integer is a strong
number or not?
[Hint:
145=1!+4!+5!
=1+24+120
=145]

Answer Posted / chandan verma

#include<stdio.h>
#include<conio.h>
void main()
{
int n,tmp,rem,sum=0;
printf("enter a number");
scanf("%d",&n);
tmp=n;
while(n!=0)
{
rem=n%10;
sum+=rem*rem*rem;
n=n/10;
}
if(tmp==sum)
printf("%d is a strong no",tmp);
else
printf("%d is not a strong no",tmp);
getch();
}
printf(

Is This Answer Correct ?    20 Yes 31 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is volatile, register definition in C

1089


Explain how can you determine the size of an allocated portion of memory?

1096


Explain about the functions strcat() and strcmp()?

1034


Explain how does free() know explain how much memory to release?

1057


Explain about the constants which help in debugging?

1356


How do I send escape sequences to control a terminal or other device?

1064


What is gets() function?

1113


can any one tel me wt is the question pattern for NIC exam

1959


Explain how do you generate random numbers in c?

1072


Explain the use of #pragma exit?

1163


What are the uses of a pointer?

1142


What is the scope of an external variable in c?

1032


What are the advantages of external class?

1049


In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)

2106


What is the difference between functions getch() and getche()?

1087