Strong number checking Code in C programing language by Code With Rudy
Code With Rudy
#include <stdio.h> void main(){ int num,temp,fact,i,r,sum=0; printf("enter the number :"); scanf("%d",&num); temp=num; while(num>0){ fact=1; r=num%10; for(i=1;i<=r;i++){ fact*=i; } sum+=fact; num=num/10; } if(sum==temp){ printf("%d is a strong number",temp); } else{ printf("%d is not a strong number",temp); } } //codewithrudy
0 Comments