+1 dave.

Sanju
:)



On Tue, Sep 6, 2011 at 3:40 PM, Dave <[email protected]> wrote:

> @Srivastav: Yeah. You need more parens:
>
> printf("%d",(int)(3.14*6.25*6.25));
>
> Without the extra parens, the 3.14 is cast to an int, but then
> implicitly recast to a double for the multiplications. With the
> parens, the product is formed in type double, and then the result is
> cast into integer.
>
> Sorry for not recognizing the need before.
>
> Dave
>
> On Sep 6, 5:18 pm, UTKARSH SRIVASTAV <[email protected]> wrote:
> > printf behaves abnormally when it sees arguments not matching with its
> > datatype............
> > @dave
> > printf("%d",(int)3.14*6.25*6.25); is also giving 0.
> >
> > --
> > *UTKARSH SRIVASTAV
> > CSE-3
> > B-Tech 3rd Year
> > @MNNIT ALLAHABAD*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" 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/algogeeks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" 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/algogeeks?hl=en.

Reply via email to