Broken calculator

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int i,j,k;
int n=sc.nextInt();
int[] a=new int[100000];
int temp=0;
a[0]=1;
int m=1;
int x;
for( i=1;i<n;i++)
{
a[i]=sc.nextInt();
}
for(i=1;i<=n;i++)
{
for(j=0;j<m;j++)
{
x=a[j]*i+temp;
a[j]=x%10;
temp=x/10;
}
while(temp!=0)
{
a[m]=temp%10;
temp=temp/10;
m++;
}
}
for(i=m-1;i>=0;i–)
{
System.out.print(a[i]);

}
}
}
the testcases are partially executing plz correct my code

@karthik1989photos,
https://ide.codingblocks.com/s/269011 corrected code.

Error:
You have added a few lines which are wrong. I have commented them in the link above for reference.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.