Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created February 28, 2019 23:49
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/a35821c30b95ef3c2494f19c50fdd061 to your computer and use it in GitHub Desktop.
Save parzibyte/a35821c30b95ef3c2494f19c50fdd061 to your computer and use it in GitHub Desktop.
#include <stdio.h> // printf
int main(void) {
double numero = 123.45;
printf("El número es %f\n", numero);
int parteEntera = (int) numero;
double parteDecimal = numero - parteEntera;
printf("Parte entera: %d. Parte decimal: %f\n", parteEntera, parteDecimal);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment