Showing posts with label not. Show all posts
Showing posts with label not. Show all posts

C and C++ Programs to Check Whether a Number is Strong Number or Not

This post contains C and C++ program to check whether a given number is Strong number or not. A strong number is a number for which the sum of factorials of its digits is equal to the number itself. The first one is C program to check whether the input number is a strong number or not. An example is 145. 1!+4!+5!=1+24+120=145 Therefore 145 is a strong number.

C Program:

#include<stdio.h>
long int factorial(int n)

{