#include <stdio.h>
void main() {
int begin,end,digit,number,i,prime,sum_digit=0,sum_prime=0;
do {
printf("please enter range<begin end> of numbers for search <begin<=end>\n");
scanf("%d%d",&begin ,&end);
}
while((begin>end)||(begin<10));
for (;begin<=end;begin++) {
number=begin;
prime=begin;
while (number>0)
{
digit=number%10;
number=number/10;
sum_digit+=digit;
}
for (i=2;prime>2;i++) {
while (prime%i==0){
prime=prime/i;
sum_prime+=i;
}
}
if (sum_prime==sum_digit)
printf("%d\n",begin);
sum_digit=0;
sum_prime=0;
}
}
please enter range<begin end> of numbers for search <begin<=end>
44
66
Oops no numbers were found!