Created
July 29, 2019 22:31
-
-
Save parzibyte/ff5f6c91bba90c3df22562e1ca912951 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Convertir int a char en C | |
@author parzibyte | |
*/ | |
#include <stdio.h> // printf | |
// Prototipo | |
char enteroACaracter(int numero); | |
int main(){ | |
int numero = 1; | |
char comoCaracter = enteroACaracter(numero); | |
printf("El entero %d se convierte a '%c' como carácter", numero, comoCaracter); | |
} | |
char enteroACaracter(int numero){ | |
return numero + '0'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment