Question : c round function
Answered by : impossible-impala-vlac48lutr4a
#include <math.h> double round(double x); float roundf(float x); long double roundl(long double x);
Source : https://stackoverflow.com/questions/39149543/using-round-function-in-c/39150104 | Last Update : Thu, 21 May 20
Question : round function in C
Answered by : grieving-gecko-8mvnc5rkt6d2
#include <stdio.h>
#include <math.h> int main()
{
float i=5.4, j=5.6;
printf("round of %f is %f\n", i, round(i));
printf("round of %f is %f\n", j, round(j));
return 0;
}
Source : https://fresh2refresh.com/c-programming/c-arithmetic-functions/c-round-function/ | Last Update : Fri, 06 Aug 21
Question : round float in C
Answered by : andreas-leonidou
#include <stdio.h>
int main (){ float a; printf("\nEnter a real number here please: "); scanf("%f",&a); printf("\nPrinting Number with different precision: "); printf("\n Number default precision: %f", a); printf("\n Number in (0 d.p.): %.0f", a); printf("\n Number in (1 d.p.): %.1f", a); printf("\n Number in (2 d.p.): %.2f", a); printf("\n Number in (3 d.p.): %.3f", a); printf("\n Number in (3 d.p.): %.4f", a); return 0;
}
Source : | Last Update : Wed, 18 May 22
Question : round C
Answered by : repulsive-rat-dirccjlqpgw1
float f = 0.5;
round(f);
Source : | Last Update : Wed, 12 Aug 20