Project #16886 - C++ Array Help

In C++, the largest int value is 2147483647. Write a program that inputs two positive integers of at most 100 digits and outputs the sum of the numbers. Your program must, at least, contain a function to read and store a number into an array. (Hint: read numbers as strings and store the digits of the number in the reverse order).

 

Please include sufficient test results in your solution.

 

 

 

#include <fstream>                                      // to use files

 

#include <iomanip>                                                      // to use manipulators

 

#include <iostream>

 

#include <cstring>

 

#define asize 100

 

using namespace std;

 

void inputInteger (char s[], int &len) {        //Implement the function to read an intger from keybouard

 

 

 

}

 

void add (char sl[], char s2[], char sum[]) {

 

 

 

}

 

int main()

 

{

 

int len;

 

char sl[asize];

 

char s2[asize];

 

char discard;

 

char sum[asize];

 

cout<<"Input sl"<<endl;

 

inputInteger(sl, len);

 

cout<<"Input s2"<<endl;

 

cin. get(discard) ;

 

inputInteger(s2, len) ;

 

cout<<endl;

 

cout<<s1<<endl;

 

cout<<s2<<endl;

 

cout<<"Output Sum"<<endl;

 

add(sl,s2,sum);

 

cout<<sum;

 

return 0;                            // Indicate successful completion

Subject Computer
Due By (Pacific Time) 11/18/2013 12:00 am
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy