Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 6, 2019 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/72951f997d65faf10df230c924969eab to your computer and use it in GitHub Desktop.
Save parzibyte/72951f997d65faf10df230c924969eab to your computer and use it in GitHub Desktop.
/*
Redondear números en C con round
@author parzibyte
parzibyte.me/blog
*/
#include<stdio.h>
#include<math.h>
int main(){
printf("0.5 redondeado con round es: %0.2f\n", round(0.5));
printf("50.48 redondeado con round es: %0.2f\n", round(50.48));
printf("20.24 redondeado con round es: %0.2f\n", round(20.24));
printf("9.7 redondeado con round es: %0.2f\n", round(9.7));
printf("10.5 redondeado con round es: %0.2f\n", round(10.5));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment