
December 16th, 2012, 11:48 PM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 4
Time spent in forums: 2 h 24 m 55 sec
Reputation Power: 0
|
|
|
Trailing Zeroes
Is there anyway I can edit my program so that the output has no trailing zeroes?
Code:
#include <stdio.h>
#include <math.h>
int main()
{
int n;
double a,b;
scanf("%d", &n);
while(n--)
{
scanf("%lf %lf", &a,&b);
printf("%.4lf\n",pow((b*a)/(b+a),2));
}
return 0;
}
Example:
2.3452 ---> 2.3452
3.500 ---> 3.5
3.4530 --->3.453
|