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 / raghuram

#include<stdio.h>
main()
{
int n,sum=0,r,f=1,i=1,m;
printf("enter anumber");
scanf("%d",&n);
m=n;
while(n>0)
{
r=n%10;
for(i=1,f=1;i<=r;i++)
f=f*i;
sum=sum+f;
n=n/10;
}
if(sum==m)
printf("the given number is strong number");
else
printf("the given number is not a strong number");
}

Is This Answer Correct ?    7 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between call by value and call by reference in c language?

1096


Explain how many levels deep can include files be nested?

1060


What does & mean in scanf?

1096


Is it better to use a macro or a function?

1146


What is substring in c?

1181


Why do we use null pointer?

1045


Is it cc or c in a letter?

1007


In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?

1213


#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??

1938


Define Array of pointers.

1090


How many levels of indirection in pointers can you have in a single declaration?

1072


How we can insert comments in a c program?

1107


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

1151


List the variables are used for writing doubly linked list program.

2012


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

1956