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 » Sat Aug 06, 2005 11:36 pm

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 » Sun Aug 07, 2005 12:49 am

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 » Sun Sep 11, 2005 4:36 am

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”