By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,385 Members | 1,737 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,385 IT Pros & Developers. It's quick & easy.

math

P: 1
please tell me how can i multiply 5 digit number with 5 digit number how can I write code this program in c++
May 31 '07 #1
Share this Question
Share on Google+
3 Replies


nemisis
P: 64
please tell me how can i multiply 5 digit number with 5 digit number how can I write code this program in c++

What have u done so far?? if you have please post it here, else u can be given hints as to how to go about making the program. Please read Posting rules here
May 31 '07 #2

P: 23
highest 5 digit number 99999 multiplied by highest 5 digit number 99999 gives you a number which takes 36 bits in binary.

I think you can easily do it using "long double" type variable as the result (instead of using integer or long integer).

But if it can be more than 5 digits which is even long double cant handle, then you have to use string operations (multiplication) :)

--Sorower
Jun 1 '07 #3

Savage
Expert 100+
P: 1,764
highest 5 digit number 99999 multiplied by highest 5 digit number 99999 gives you a number which takes 36 bits in binary.

I think you can easily do it using "long double" type variable as the result (instead of using integer or long integer).

But if it can be more than 5 digits which is even long double cant handle, then you have to use string operations (multiplication) :)

--Sorower
Long double can hadle up to 1.1e+4932,which is more then anough (it takes factorial of 15xx)

Savage
Jun 1 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.