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 an array in c?

1059


What is pointer and structure in c?

1193


What is static function in c?

1124


Write a Program to accept different goods with the number, price and date of purchase and display them

6240


I need previous papers of CSC.......plz help out by posting them.......

2298


Where static variables are stored in memory in c?

1006


C program to find all possible outcomes of a dice?

2365


What is the use of putchar function?

1060


Why can’t constant values be used to define an array’s initial size?

1386


How many keywords (reserve words) are in c?

1146


What is the purpose of 'register' keyword in c language?

1033


What is c programming structure?

1211


How can I list all of the predefined identifiers?

986


What is a memory leak? How to avoid it?

1353


What is the difference between #include and #include 'file' ?

1067