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 / giridhar
#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;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 ? | 27 Yes | 11 No |
Post New Answer View All Answers
How are portions of a program disabled in demo versions?
How main function is called in c?
What happens if header file is included twice?
show how link list can be used to repersent the following polynomial i) 5x+2
What is floating point constants?
if p is a string contained in a string?
using for loop sum 2 number of any 4 digit number in c language
what is bit rate & baud rate? plz give wave forms
Tell me when is a void pointer used?
What are the differences between new and malloc in C?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures
What is data structure in c programming?
given post order,in order construct the corresponding binary tree
What is the purpose of main( ) in c language?
What is calloc()?