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 do you mean by Recursion Function?

1073


What is the difference between call by value and call by reference in c?

1115


What does it mean when a pointer is used in an if statement?

1064


What is exit() function?

968


How can I delete a file?

1020


Can two or more operators such as and be combined in a single line of program code?

1312


When can you use a pointer with a function?

995


Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.

3640


What is meant by type casting?

1023


How can a program be made to print the line number where an error occurs?

1038


What is local and global variable in c?

1131


How arrays can be passed to a user defined function

968


Can we declare variables anywhere in c?

950


What are the types of data types and explain?

1038


What does %2f mean in c?

1163