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
Define macros.
Explain 'bit masking'?
Explain modulus operator.
What are the basic data types associated with c?
What oops means?
How can I get back to the interactive keyboard if stdin is redirected?
What are nested functions in c?
What is hashing in c?
How are structure passing and returning implemented?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
What is #error and use of it?
What are the primitive data types in c?
Is boolean a datatype in c?
What are identifiers in c?
Is c compiled or interpreted?