Skip to content

Instantly share code, notes, and snippets.

@jmramirezpro
Created December 3, 2015 12:25
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 jmramirezpro/58f99cbd57deaffe24e8 to your computer and use it in GitHub Desktop.
Save jmramirezpro/58f99cbd57deaffe24e8 to your computer and use it in GitHub Desktop.
Contiene el código fuente de la actividad propuesta en el episodio 12 del podcast código fuente
/*
* EntradaSalida.c
* Segundo programa que vemos en el podcast Codigo Fuente
* Manejo de la entrada salida básica
* Creado el 04 de dic. de 2015
* Author: jmramirez
*/
#include <stdio.h>
int main(void) {
/* Definición de variables */
int i = 0; /* variable de tipo entero */
float f = 0.0F; /* variable de tipo real */
char c = 'a'; /* variable de tipo caracter */
char tira[32]; /* cadena de caracteres (string)*/
printf ("Escriba un caracter: \n");
scanf ("%c", &c);
printf ("La letra es %c \n", c);
printf ("Escriba un numero entero: \n");
scanf ( "%d", &i);
printf ( "El numero es %i \n", i);
printf ("Escriba un numero real flotante: \n");
scanf ( "%f", &f);
printf ("El numero es %f \n", f);
printf ("Escriba un string: \n");
scanf ("%s", &tira);
printf ("El string es %s \n", tira);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment