
multiplying 100 digits numbers to eachother

Hi Friend,
Try this:
import java.math.*;
import java.util.*;
class ProductOfDigits{
public static void main(String[] args){
Scanner input=new Scanner(System.in);
System.out.print("Enter Number: ");
BigInteger bi=input.nextBigInteger();
String strSum = bi.toString();
BigInteger num=new BigInteger("1");
for(int i = 0;i < strSum.length(); i++){
char ch=strSum.charAt(i);
num=num.multiply(new BigInteger(Character.toString(ch)));
}
System.out.println(num);
}
}
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.