easy C programming question

I made a program thats reads X and Y values from a

ascii file,converts the values from english to metric,

and writes the data to another file.

I use fscanf(fp,"%f",&X) and fprintf(fp,"%.3lf",X) for this. If X = 1.71, result will be X43.434..good

If X = .03937 result will be X1.000. How do I

eliminate the trailing zero's before output so my answer will be X0. Thanks,


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!