DropsBrowse Pastes
Login with GitHub

2.1

March 1st, 2022Views: 14(0 unique)C
#include <stdio.h>
#include <math.h>
float fun(float,int);
int main(void)
{
    float y,j;
    int w;
    scanf("%f %d",&y,&w);
    j = fun(y,w);
    printf("%f",j);
}
float fun(float x,int m)
{
    float a = (int)(x * pow(10,m) + 0.5) / pow(10,m);
    return a;
}