Answer to Question #300697 in C++ for adi

Question #300697

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)



1
Expert's answer
2022-02-22T01:10:59-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog