Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1.Write a program to add two large integers with up to 300digits. One approach i

ID: 3608939 • Letter: 1

Question

1.Write a program to add two large integers with up to 300digits. One approach is to treat each number as a list, each ofwhose elements is a block of digits of that number. For example,the integer 179,534,672,198 might be stored with block [0]=198,block [1]= 672, block [2]= 534, block [3]= 179. Then add twointegers (lists), element by element, carrying from one element tothe next when necessary.

2.Write a program for the prime number-finder problem in Problem1, but use a dynamically allocated array.

Explanation / Answer

please rate - thanks (please rateboth responses) part 1 #include int input(int[],int,int); int max(int,int); int add(int,int,int&); void output(int,int); int main() {intnum1[100]={0},num2[100]={0},size1,size2,ans[101]={0},sizeans,overflow=0,i; size1=input(num1,100,1); size2=input(num2,100,2); sizeans=max(size1,size2); for(i=0;i0)     {sizeans++;     cout