#include <iostream> using namespace std; int main() { int x, y, z, p; cin>> x; cin>> y; z = x * y; p = z + 1; cout<< p <<"\n"; z = z * p; p = z + 1; cout<< p <<"\n"; cin.get(); }

# Beginner Help - Working With Large Numbers

Page 1 of 1## 4 Replies - 1244 Views - Last Post: 03 July 2010 - 10:10 AM

### #1

# Beginner Help - Working With Large Numbers

Posted 03 July 2010 - 06:13 AM

I just began to learn C++ a couple days ago, and it is my first programming i've done. I would really like to know how to work with really large numbers, preferably with no limit to the amount of digits(if that is possible) Could someone please point me in the right direction? Below is something I have written and that I would like to be able to use with really large numbers.

##
**Replies To:** Beginner Help - Working With Large Numbers

### #2

## Re: Beginner Help - Working With Large Numbers

Posted 03 July 2010 - 06:53 AM

A long double is 8 bytes, and can contain up to 15 digits.

### #3

## Re: Beginner Help - Working With Large Numbers

Posted 03 July 2010 - 09:47 AM

Quote

I would really like to know how to work with really large numbers

Quote

preferably with no limit to the amount of digits(if that is possible)

### #4

## Re: Beginner Help - Working With Large Numbers

Posted 03 July 2010 - 10:05 AM

Oler1s, on 03 July 2010 - 08:47 AM, said:

Quote

I would really like to know how to work with really large numbers

Quote

preferably with no limit to the amount of digits(if that is possible)

ahaha, I meant as in the program would be able to handle as many digits as my hardware could store, cause right now its limited to like 10 digits or something. I'll look into arbitrary precision arithmetic, thanks for that.

### #5

## Re: Beginner Help - Working With Large Numbers

Posted 03 July 2010 - 10:10 AM

Page 1 of 1