multiply of 100 digits numbers

Ads
 

multiply of 100 digits numbers

multiplying 100 digits numbers to eachother

View Answers

January 12, 2011 at 3:43 PM

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

Ads









Related Tutorials/Questions & Answers:
multiply of 100 digits numbers
multiply of 100 digits numbers  multiplying 100 digits numbers to eachother
Generate random numbers from 1 to 100
Generate random numbers from 1 to 100  1)A class Called: RandomNumberGenerator that generate random numbers from 1 to 100 2)A class Test that tests the hierarchy in A) especially the getArea() and getVolume() methods. Use
Advertisements
Prime numbers in Java between 1 and 100
Prime numbers in Java between 1 and 100  Hi, How to display prime numbers in java between 1 and 100? Thanks   Hi, Prime numbers... which prints prime numbers between 1 and 100. Here is complete for printing prime
How to list even numbers between 1 and 100?
How to list even numbers between 1 and 100?  Hi, I Java to check if a number is even? How to list even numbers between 1 and 100? Thanks  ... the numbers between 1 and 100 for (int i=1;i <=num ; i++){ if(i%2==0
Mysql Multiply
Mysql Multiply       Mysql Multiply is used to define the product of any two or more numbers in a table. Understand with Example The Tutorial illustrate an example
Mysql Multiply
Mysql Multiply       Mysql Multiply is used to define the product of any two or more numbers... Multiply'. The example elaborate a query that help you to return the product of any
Hexadecimal numbers multiplication
Hexadecimal numbers multiplication  Sir, I have to multiply 128 bit hexadecimal numbers. Do u have any logic for this?? The numbers are like ab7564fa342b5412c34d9e67ab341b58
ModuleNotFoundError: No module named 'digits'
ModuleNotFoundError: No module named 'digits'  Hi, My Python... 'digits' How to remove the ModuleNotFoundError: No module named 'digits'... to install padas library. You can install digits python with following command
ModuleNotFoundError: No module named 'etl-multiply'
ModuleNotFoundError: No module named 'etl-multiply'  Hi, My Python... 'etl-multiply' How to remove the ModuleNotFoundError: No module named 'etl-multiply' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'python-digits'
ModuleNotFoundError: No module named 'python-digits'  Hi, My... 'python-digits' How to remove the ModuleNotFoundError: No module named 'python-digits' error? Thanks   Hi, In your python
java program_big digits multiplication..
java program_big digits multiplication..  i want program about big digits multiplication program using java..plz tel me answer
odd numbers with loop
odd numbers with loop  get the odd numbers till 100 with for,while loop   Java find odd numbers: class OddNumbers { public static void main(String[] args) { for(int i=1;i<=100;i
Implementing Digits restriction Using JQuery
Implementing Digits restriction Using JQuery  Hi Sir I have following field in my html form : <div>Age<input type="text" name="quantity...("&nbsp;&nbsp;Digits Only").show(); return false
ModuleNotFoundError: No module named 'digits-py-lib'
ModuleNotFoundError: No module named 'digits-py-lib'  Hi, My... 'digits-py-lib' How to remove the ModuleNotFoundError: No module named 'digits-py-lib' error? Thanks   Hi, In your python
Java bigdecimal multiply method example
Java bigdecimal multiply method example   ... multiply method example. Method returns a bigdecimal object value. Method... for using the method : public BigDecimal multiply(BigDecimal multiplicand
print the sum of even number from 1 to 100
print the sum of even number from 1 to 100  how to print the sum of even number from 1 to 100 using for loops? Thanks
sorting numbers
sorting numbers  How to sort the numbers in ascending order   import java.util.*; class SortNumbers{ public static void main(String...=input.nextInt(); list.add(num); } System.out.println("Numbers
Prime Numbers
Prime Numbers  Create a complete Java program that allows the user to enter a positive integer n, and which then creates and populates an int array with the first n prime numbers. Your program should then display the contents
Java bigdecimal multiply example
Java bigdecimal multiply example       Example below demonstrates bigdecimal class multiply... BigDecimal multiply(BigDecimal multiplicand) BigDecimal objects with names x ,y
java string replace all non digits
java string replace all non digits  Hi, I am doing some processing on the text data. I have requirement to remove all the charaters from the data except the digits. How to replace all non digits in a string with some character
Formatting numbers in Velocity Templates?
Formatting numbers in Velocity Templates?  I need to display amount in following formats: 1099 -> 1,099.00 100 -> 100.00 100.251 -> 100.25 10999 -> 10,999.00 1110999 -> 11,10,999.00 Right now I am using
Formatting numbers in Velocity Templates?
Formatting numbers in Velocity Templates?  I need to display amount in following formats: 1099 -> 1,099.00 100 -> 100.00 100.251 -> 100.25 10999 -> 10,999.00 1110999 -> 11,10,999.00 Right now I am using
Numbers pyramid
Numbers pyramid  Hi sir, Can you please tell me how to output this using nested for loops? 1 2, 1 1, 2, 3 4, 3, 2, 1 1, 2, 3, 4, 5 6, 5, 4, 3, 2, 1 1, 2, 3, 4, 5, 6, 7 8, 7, 6, 5, 4, 3, 2, 1 1, 2, 3, 4, 5, 6, 7, 8, 9 10, 9, 8
Rational Numbers
Rational Numbers   Write and fully test a class that represents rational numbers. A rational number can be represented as the ratio of two integer values, a and b, where b is not zero. The class has attributes for the numerator
print the even numbers between the range 100-200
print the even numbers between the range 100-200  Q ?write... prints out the even numbers between the range of 100 and 200 and then determine... the even numbers between 100 and 200. class EvenNumbers { public static
Listing all even numbers between two numbers
Listing all even numbers between two numbers  Hi, How to write code to list all the even numbers between two given numbers? Thanks   Hi, You function will take 2 numbers and the find the even numbers between
how to add to numbers in java
how to add to numbers in java  how to add to numbers in java
Addition of two numbers
Addition of two numbers  addition of two numbers
ModuleNotFoundError: No module named 'numbers'
ModuleNotFoundError: No module named 'numbers'  Hi, My Python... 'numbers' How to remove the ModuleNotFoundError: No module named 'numbers... to install padas library. You can install numbers python with following command
write an application that print out the even numbers between the range 100-200
write an application that print out the even numbers between the range 100-200   write an application that print out the even numbers between the range 100-200 ?   The given code accepts the number from 100 to 200
Adding two numbers
Adding two numbers  Accepting value ffrom the keyboard and adding two numbers

Ads