Round Function


  • The Round function is used for rounding off .
  • It returns the value of argument rounded to the nearest integer.
  • Values exactly between two integral values , are rounded up .

  • Syntax:

    float roundf(float arg);
    
    double round(double arg);
    
    long double roundl(long double arg) ;

    Example:

    #include <math.h>
    #include <stdio.h>
    
      int main()
      {
        printf("%f\n", round (4.2));
    	printf("%f\n", round (4.5));
        printf("%f\n", round (4.7));
    	
        return 0;
      }
     
    Back