Greetings everyone, I wrote a program to check if a number is peterson or not and does not seems to be working. Can anyone please check it out.
Thank you in advance.Code:#include <stdio.h> #include <conio.h> #include <math.h> int main() {long int sum=0,f,copy,fact, num; clrscr(); printf("Entre a Number:"); scanf("%ld", &num); num=copy; while(num>0) {for(f=num%10, fact=1;f>0;f--) {fact=f*fact;} sum+=fact; num/=10;} if(sum==copy) printf("The Number is piterson number"); else printf("The Number is Not piterson Number"); getch(); return 0;}