printf("0.0lf",n) doesn't ignore decimal part, it rounds up to the nearest
integer value, to really discard (truncate) you should use
printf("%d",(int)n);

On Mon, May 10, 2010 at 12:33 AM, Bartholomew Furrow <[email protected]>wrote:

> hi,
>> in C, normally we use printf("%0.0lf",n) to ignore the decimal part..
>> while printing..
>
>
> Though if you're doing a floating-point calculation for something with an
> exact integer answer, you're probably doing something wrong, and should
> consider using long long instead.
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-code%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

Reply via email to