-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathq019.cpp
More file actions
31 lines (25 loc) · 822 Bytes
/
q019.cpp
File metadata and controls
31 lines (25 loc) · 822 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
#include <iostream>
int main(){
int i;
double temp;
char unidade;
std::cout<< "quer converter: "<<std::endl;
std::cout << "1 - celcius para fahrenheit"<< std::endl;
std::cout << "2 - fahrenheit para celcius"<< std::endl;
std::cin >> i;
switch(i){
case 1:
std::cout << "digite a temperatura (em celcius): "<< std::endl;
std::cin >> temp;
temp = (9*temp/5) + 32;
std::cout << "a temperatura em fahrenheit é: "<< temp << std::endl;
break;
case 2:
std::cout << "digite a temperatura (em fahrenheit): "<< std::endl;
std::cin >> temp;
temp = (temp - 32)*5/9;
std::cout << "a temperatura em celcius é: "<< temp << std::endl;
break;
}
return 0;
}