print long long

Write here if you have problems with your C source code

Moderator: Board moderators

Post Reply
geran
New poster
Posts: 13
Joined: Sun Jun 19, 2005 4:36 pm

print long long

Post 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?
jdmetz
New poster
Posts: 25
Joined: Fri May 27, 2005 5:23 pm
Location: Ann Arbor, MI USA

Post by jdmetz »

printf("%lld", result) is what you are looking for.
midra
Experienced poster
Posts: 119
Joined: Fri Feb 13, 2004 7:20 am
Contact:

Post 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
Post Reply

Return to “C”