how can i perform multipication of two very large numbers(example 10^18 * 10^18) and store them in C language.?
You can do it in the manner you would do by hand - multiplying, carrying, etc using an array of integers, and then store it in a 2d array, or as a string. Some other fast multiplication algorithms are -
The Karatsuba algorithm is a fast multiplication algorithm. It was discovered by Anatoly Karatsuba in 1960 and published in 1962. It is a divide-and-conquer algorithm that reduces the multiplication of two n-digit numbers to three multiplications of n/2-digit numbers and, by repeating this reduction, to at most
n
log
2
3
The Kara...
Toom–Cook, sometimes known as Toom-3, named after Andrei Toom, who introduced the new algorithm with its low complexity, and Stephen Cook, who cleaned the description of it, is a multiplication algorithm for large integers.
Given two large integers, a and b, Toom–Cook splits up a and b into k smaller parts each of length l, and performs operations on the parts. As k grows, one may combine many of the multiplication sub-operations, thus reducing the overall computational complexity of the algorit...
(Fast Fourier Transform based multiplication) FFT based multiplication of large numbers
Hope this Helps!
karatsuba will be helpful… thanks @ priyanshu_95