-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemperatura_menu.c
More file actions
52 lines (39 loc) · 947 Bytes
/
Copy pathtemperatura_menu.c
File metadata and controls
52 lines (39 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*programa con funciones para convertir de celsius a fahrenheit con funciones*/
#include <stdio.h>
void menu();
void celsiusFahrenheit();
void celsiusKelvin();
int main()
{
menu();
}
void menu()
{
int opcion;
do{
printf("\n\n\t MENU");
printf("\n\n\t 1. calcular la temperatura en Fahrenheit");
printf("\n\n\t 2. calcular la temperatura en kelvin");
scanf("%i",&opcion);
switch(opcion)
{
case 1:celsiusFahrenheit();break;
case 2:celsiusKelvin();break;
}
}
while(opcion !=3);
}
void celsiusFahrenheit(){
float temperaturac, f;
printf("\n\n\t digite el valor de temperatura el celsius:");
scanf("%f",&temperaturac);
f=((9*temperaturac)/5 ) +32;
printf("\n\n\t el valor de la temperatura en fahrenheit es:%.2f",f);
}
void celsiusKelvin(){
float c, k;
printf("\n\n\t digite el valor de temperatura el celsius:");
scanf("%f",& c);
k=c+273;
printf("\n\n\t el valor de la temperatura en kelvin es:%.2f",k);
}