#include <stdio.h>
#include <stdlib.h>
int add(int i, int j , int k)
{
while ( i != 0)
{
j = i % 10;
k = k * j;
i = i / 10;
}
return k;
}
int main ()
{
int num, num2=1, r;
int ret=1;
int i=0;
scanf("%d",&num);
int answer = add(num , r ,num2);
while (num > 0)
{
num = answer;
answer = add(num , r ,num2);
if (num < 10)
{
printf("%d \n ",answer);
system("PAUSE");
return 0;
break;
}
}
printf("%d \n ",answer);
system("PAUSE");
return 0;
}
SDDMV 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.