Thread: Doubt in C
View Single Post
Old 20-03-2007, 04:11 PM   #15 (permalink)
abhi1301
gEttIn 0uT@@@ BOXX
 
abhi1301's Avatar
 
Join Date: Mar 2007
Location: in the webspace
Posts: 86
Default Re: Doubt in C

Quote:
Originally Posted by The Unknown
Ha hA ha ha.
Or u better start trusting the replies in here .. Shilesh is perfectly correct .. it's 6 point precision by default and u cannot do anything about it if u want the value just 1 or 2 places do it just like it's written .. change the precision of output wid
printf("salary is %.3f\n", salary );

being more clear this will print upto 3 places after decimal if u write
printf("salary is %.2f\n", salary );

this prints 2 values and so on ..
__________________
Koi CHAKAR NAHI HAI >> SAB JUGAAD HAI
abhi1301 is offline