logo

CuriousTab

CuriousTab

Discussion


Home Technical Questions Programming Comments

  • Question
  • Write a c program to check whether a number is strong or not.


  • Correct Answer
  • #include int main(){ int num,i,f,r,sum=0,temp; printf("Enter a number: "); scanf("%d",&num); temp=num; while(num){ i=1,f=1; r=num%10; while(i<=r){ f=f*i; i++; } sum=sum+f; num=num/10; } if(sum==temp) printf("%d is a strong number",temp); else printf("%d is not a strong number",temp); return 0; } Sample output: Enter a number: 145 145 is a strong number 


  • Programming problems


    Search Results


    • 1. C program to find the factorial of a given number
    • Discuss
    • 2. Write a program to generate the Fibonacci series in c?
    • Discuss
    • 3. Swap two variables without using third variable.
    • Discuss
    • 4. Why we use do-while loop in c?
    • Discuss
    • 5. Write a c program to create dos command type.
    • Discuss
    • 6. Write a c program to print multiplication table
    • Discuss
    • 7. Write a c program for selection sort.
    • Discuss
    • 8. Write a c program for quick sort.
    • Discuss
    • 9. Write a c program for insertion sort.
    • Discuss
    • 10. Write a c program for merge sort.
    • Discuss


    Comments

    There are no comments.

Enter a new Comment