Page 1 of 1

print long long

Posted: Sat Aug 06, 2005 11:36 pm
by geran
How can I output a long long?

I got something like this,

long long result;
... somecalculation
printf(???,result);

how can I print the result?

Posted: Sun Aug 07, 2005 12:49 am
by jdmetz
printf("%lld", result) is what you are looking for.

Posted: Sun Sep 11, 2005 4:36 am
by midra
jdmetz is right
but remember that if you are in windows you must use
printf("%I64d",result)
I think that "%I64d" is always when you are using windows, I am not sure...

but when you submit the program to the online judge be sure to write
%lld