Apr 5, 2015 at 4:15pm UTC
<code>
#include <iostream>
using namespace std;
int main
{
char A[12]="47000000000";
char B[12]="47000000000";
char C[12]="47000000000";
cout << "Enter 3 numbers to multiply(1-13 digits): ";
cin >> A[11];
cin >> B[11];
cin >> C[11];
char D[39]="10382300000000000000000000000000000000";
cout << D << D[38] << endl;
cin >> D[38];
}
</code>
What changes should I make to the computer program above
to allow the user to enter any values that fits within the
array sizes: [12] , [12] , [12] , [39] .
Last edited on Apr 5, 2015 at 4:16pm UTC
Apr 5, 2015 at 4:26pm UTC
You can use unsigned long double
data type.
PS: Please use code tags...
Last edited on Apr 5, 2015 at 4:30pm UTC
Apr 5, 2015 at 11:03pm UTC
I did use (code tags) you should have paid attention to the contents of my first post!
Because if you did, you would see them right where they need to be.
Last edited on Apr 5, 2015 at 11:04pm UTC
Apr 5, 2015 at 11:14pm UTC
@cppnerd . Your Post Does not have code tags in any way shape or form. Look closer...
With Code tags:
int x = 5;
Without:
int x = 5;
Last edited on Apr 5, 2015 at 11:25pm UTC
Apr 6, 2015 at 12:59am UTC
code tags are used by [ code ] [ /code ] (ignore the white spaces) and not by <code> </code>
I think your habit of using <> is because of html, isn't it @cppnerd?
Apr 6, 2015 at 9:49am UTC
my bad...
unsigned long int
will that work?
Apr 6, 2015 at 10:07am UTC
@programmer007
No. Look up the maximum value for that type and see how many digits it has :+)
One needs a library to do this because the largest unsigned value (64 bit) is still not big enough.
Regards :+)
Apr 6, 2015 at 11:18am UTC
Just curious
Which is the most precise data type (within standard library)???
Apr 6, 2015 at 12:06pm UTC
@programmer007
Well, on a 64 bit machine unsigned long long int
But it is better to use a cstdint.h
type like uint64_t
(platform independent). The maximum is still 64 bit which is about half of what the OP requires.