hi i was trying to solve proizvod in C and it works only for 3 test cases. can someone check my noble code and tell me where is my mistake.
thanks
thanks
#include <stdio.h>
int last_two(long long int n);
int main(void)
{
int n;
long long int fak=1;
scanf("%d",&n);
while(n>0)
{
fak=fak*n;
fak=last_two(fak);
n--;
}
printf("%lld\n",fak);
return 0;
}
int last_two(long long int n)
{
int i=0;
int dig;
int a[3];
while(n>0&&i<3)
{
dig=n;
if(dig!=0)
a[i++]=dig;
n/=10;
}
return a[1]*10+a[0];
}