Addition of Big Integer
In this problem, you have to take two char arrays of numbers (e.g., “1203009954” and
“109876201453”) from the user and add these two numbers and store answer in a third char array digit by digit (“111079211407”).
char* additionOfBigInteger(char * Num1, char* Num2)
Subtraction of Big Integer
In this problem, you have to take two char arrays of numbers (e.g., and “1203009954”
“109876201453”) from the user and subtract these two numbers and store answer in a third char array digit by digit (“-108673191499”).
char* subtractionOfBigInteger(char * Num1, char* Num2)
Multiplication of Big Integer
In this problem, you have to take two char arrays of numbers (e.g., and “1203009954”
“109876201453”) from the user and multiply these two numbers and store answer in a third char array digit by digit (“132182164055668263162”).
char* multiplicationOfBigInteger(char * Num1, char* Num2)
#include <stdoo.h>
using namespace std;
char *additionOfBigInteger(char *Num1, char *Num2) {
return to_string(stoll(Num1) + stoll(Num2)).c_str();
}
char *subtractionOfBigInteger(char *Num1, char *Num2) {
return to_string(stoll(Num1) - stoll(Num2)).c_str();
}
char *multiplicationOfBigInteger(char *Num1, char *Num2) {
return to_string(stoll(Num1) * stoll(Num2)).c_str();
}
int main() {
return 0;
}
Comments
Leave a comment