Storing and displaying square of 11 digit integer

largenos

#1

If we find the square of a 11 digit integer , the answer is in 21 digits or more, which even an unsigned long long int cant store . How can we calculate the square of such big numbers ? How to store and display such big numbers?


#2

http://www.quora.com/How-do-I-multiply-two-large-numbers-stored-as-strings-in-the-C-C++-language


#3

you can get some idea from here …
http://www.geeksforgeeks.org/factorial-large-number/?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+Geeksforgeeks+(GeeksforGeeks)


#4

BigInteger Class in Java can be really helpful in such circumstances, to a certain extent.


#5

use long it will help istead of int


#6

no largest value that can be saved in C/C++ using a datatype is 10^18 that too using unsigned long long…!! SO either you have to use an array or string… or code a big num class in c++


#7

Is there no other way other than using array or strings in c?