can long long stor 12 dig num?ifno, without array how 2 do?

0

can long long store 12 digit numbers.
Its showing in my comp that limit of long long is 9223372036854775807, but then it's showing too large when i declare it like this:
long long num;
i don't want to store in array.
My seniors told that long long will do but i am having trouble.
please help.

>i don't want to use array.
In that case there's probably no other choice left than choosing for a Big Number library like GNU MP, it can handle much bigger numbers than a standard C++ datatype can...

frankly, i didn't know that we can marl thread as solved.
But wait, i need to know something more.
While using cin to take a long long int, can simple method,
long long num;
cin>>num;
will do or not ??
and suppose we use it in a code like this,

#include<iostream>
using namespace std;
int main()
{
long long i;
for (i=999999999;i<1234567890123;++i)
if (i%100000000==0)
cout<<i;
}

it's again showing
integer constant is too large for ‘long’ type
so how to correctly implement it???

> integer constant is too large for ‘long’ type
Oh come on, we've told you how to fix "long long" constants, can't you at least make some intuitive guess as to how to fix "long" ?

And "mark as solved" is a link at one end of the thread (top or bottom, I forget, you can find it).

The integers are too big. You will have to explicitly flush the stream as it takes a hell lot of time to generate the next number which makes your condition true.
Also, postfix LL after the long long constants as already told by others.

#include<iostream>
using namespace std;
int main()
{
unsigned long long i;
for (i=999999999LL;i<1234567890123LL;++i)
if (i%100000000==0)
cout<<i<<flush; //check here
}

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.

This is the result of previous question answered :

Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.