how to read 25 digit number in java????
i want to write a porgram to perform addditon and substraction between 25 digit numbers

Edited 6 Years Ago by kishore sy: n/a

what do u mean by read..isit it from given data , random number or input by urself

i want to write a program to addition,substraction,multiplication&division of 25 digit number
please help me

class test
	public static void main(String[] args)
		int count,add,sub,multi,div;
		int data[] = new int [25];
		count =1;

		for (int i=0 ; i < 25 ; i++)
				data[i] = count;
				System.out.print(count+" ");

		for (int i=0 ; i <25 ; i++)
			add += data[i];
			sub -= data[i];
			multi *= data[i];
			div /= data[i];
		System.out.println("addittion : "+add+" ");
		System.out.println("substaction : "+sub+" ");
		System.out.println("multiple : "+multi+" ");
		System.out.println("division : "+div+" ");


Edited 6 Years Ago by -Ice-: n/a

i want to write a java prodram to add/multiply/substraction/divide two 25 digit numbers


hey, i saw
that reply is for ice not for u
please provide a syntax for converting string to biginteger, i did't understand that.
please help me.........

Each hexadecimal digit represents four binary digits (bits) (also called nibble), and the first use of hexadecimal notation is a representation of the binary values encoded nice man on the computer and digital electronics.

sorry sir,
please post the program if u can,
or atlest post syntax...
any way, thanks sir that is very useful link but i am very new to java so i cant understand.. please help me

Just look at the API of the class BigInteger. Use the constructor to create the object and use the methods it has for adding, subtracting, ....

BigInteger bi1 = new BigInteger("123123414123412341241243");

Edited 6 Years Ago by javaAddict: n/a

thanks sir,
i will try
sir please give a syntax if u can
because i am very new to java (i know c very well

sir please give syntax for methods also
please............ sir
help me

//BigInteger(String val)
//Translates the decimal String representation of a BigInteger into a BigInteger.

BigInteger bi1 = new BigInteger("123123414123412341241243");

If you look at that link you will find the methods that do what you want. Create 2 BigInteger objects and then call the methods you want:

BigInteger bi1 = new BigInteger("123123414123412341241243");

this is my last reply
please give syntax for add,substract,multiply,divide methods in BigInteger
pleeeeeeeeeeese if u can, give total java prog.code for read two 25 digit numbers and perdorm add,substract,multiply,divide on those two numbers
please sir
this is my last reply
any way, i am very thank full to u sir
i am very new to java programing sir so, please help me with out hesitation..

This question has already been answered. Start a new discussion instead.