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 / rajesh kumar s
void main()
{
int n,t,f=1,s=0,num;
printf("enter the num \t:");
scanf("%d",&n);
num=n;
while(num)
{
t=num%10;
f=1;
while(t)
{
f=f*t;
t--;
}
s=s+f;
num=num/10;
}
if(n==s)
printf("%d is a strong number",n);
else
printf("%d is not a strong number",n);
}
| Is This Answer Correct ? | 83 Yes | 17 No |
Post New Answer View All Answers
What is an auto keyword in c?
What is #error and use of it?
How does placing some code lines between the comment symbol help in debugging the code?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
What is the meaning of && in c?
How can I change the size of the dynamically allocated array?
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
What is atoi and atof in c?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
How many types of functions are there in c?
What are header files and what are its uses in C programming?
What is the most efficient way to store flag values?
Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.
Can true be a variable name in c?
What does stand for?