Skip to content

Instantly share code, notes, and snippets.

@jmramirezpro
Created February 5, 2016 07:46
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/f1abc166113174bf137f to your computer and use it in GitHub Desktop.
Save jmramirezpro/f1abc166113174bf137f to your computer and use it in GitHub Desktop.
/*
* Termostato.c
* Solución a los ejercicios del podcast Codigo Fuente - Programa 20
* Programa que define y usa un termostato virtual
* Creado el 02 de feb. de 2016
* Author: jmramirez
*/
#include <stdio.h>
/* Definición de tipo de datos propio */
typedef float Temperatura;
struct Termostato {
Temperatura temp_min;
Temperatura temp_max;
};
typedef struct Termostato TermostatoACME;
int main(void)
{
TermostatoACME termo;
termo.temp_min = 3.5;
termo.temp_max = 20.0;
printf("La temperatura puede oscilar entre %4.2f y %4.2f \n", termo.temp_min, termo.temp_max);
return(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment