#include <stdio.h>
#include<math.h>
void main()
{
int I,R,N;
scanf("%d %d %d",&I,&R,&N);
float G=0.0;
if(N>40)
{
G=40*R+(N-40)*R*1.5;
}
else
{
G=R*N;
}
G=G-G*0.03625;
G=roundf(G*100)/100;
printf("%.2f",G);
}
#include<math.h>
void main()
{
int I,R,N;
scanf("%d %d %d",&I,&R,&N);
float G=0.0;
if(N>40)
{
G=40*R+(N-40)*R*1.5;
}
else
{
G=R*N;
}
G=G-G*0.03625;
G=roundf(G*100)/100;
printf("%.2f",G);
}
the expected output is 1927.500 and my output is 1927.50 what should i do ?? plaese solve this
ReplyDeleteChange printf("%.2f",G) to printf("%.3f",G)
ReplyDeleteeven though it is not getting executed
Delete
Deletevitdiscussions.blogspot.com