You are on page 1of 1

//Este programa muestra los grados celsius a farenheit

#include <stdio.h>
int main(){
float farenheit, celsius, resul, valor;
char tipo;
printf("Este programa muestra los grados celsius a farenheit y veceversa \n\n");
printf("Dame un Valor: ");
scanf("%f",&valor);
printf("Que tipo es [ c o f]: \n\n ");
tipo=getche
if(tipo== 'c'|| yipo == 'C') {
resul=(1.8 * valor) + 32;
printf("farenheit= %10.2f\n, resul)");
} else if (tipo=='f' || tipo == 'F'){
resul=(valor - 32)/ 1.8;
printf("celsius=%10.2f\n", resul);
}
getch();
return 0;
}

You might also like