#include<stdio.h>
#include<math.h>
void main()
{
int m;
float s;
scanf("%d",&m);
scanf("%f",&s);
int time;
time=m*60;
time+=(int)(s+0.5);
float fps=5280.0/time;
fps=roundf(fps*100)/100;
float mps=1609.34/time;
mps=roundf(mps*100)/100;
printf("%.2f fps\n",fps);
printf("%.2f mps",mps);
}
#include<math.h>
void main()
{
int m;
float s;
scanf("%d",&m);
scanf("%f",&s);
int time;
time=m*60;
time+=(int)(s+0.5);
float fps=5280.0/time;
fps=roundf(fps*100)/100;
float mps=1609.34/time;
mps=roundf(mps*100)/100;
printf("%.2f fps\n",fps);
printf("%.2f mps",mps);
}
the expected output is 22.00 fps but our output is 22 fps what should we do to rectify it.
ReplyDeleteyes the problem was updated..when i solved it the output was in that format ..So just replace the last 8 line of output with just 2 lines
ReplyDeleteprintf("%.2f fps",fps);
printf("%.2f mps",mps);