summaryrefslogtreecommitdiff
path: root/sem_2/HLIN202/TP/TP1/ex7
diff options
context:
space:
mode:
authorGaspard Coulet <gaspard.coulet@mines-ales.org>2021-04-28 23:05:53 +0200
committerGaspard Coulet <gaspard.coulet@mines-ales.org>2021-04-28 23:05:53 +0200
commit9fe033ea88c2f705ec18c232873d056e0c229d72 (patch)
tree0647dc8c51610c7336c88c04de2068ea14b21e17 /sem_2/HLIN202/TP/TP1/ex7
Initial commit
Diffstat (limited to 'sem_2/HLIN202/TP/TP1/ex7')
-rw-r--r--sem_2/HLIN202/TP/TP1/ex7/exo7convbin0 -> 13448 bytes
-rw-r--r--sem_2/HLIN202/TP/TP1/ex7/exo7conv.cpp22
2 files changed, 22 insertions, 0 deletions
diff --git a/sem_2/HLIN202/TP/TP1/ex7/exo7conv b/sem_2/HLIN202/TP/TP1/ex7/exo7conv
new file mode 100644
index 0000000..fe731d5
--- /dev/null
+++ b/sem_2/HLIN202/TP/TP1/ex7/exo7conv
Binary files differ
diff --git a/sem_2/HLIN202/TP/TP1/ex7/exo7conv.cpp b/sem_2/HLIN202/TP/TP1/ex7/exo7conv.cpp
new file mode 100644
index 0000000..3519b24
--- /dev/null
+++ b/sem_2/HLIN202/TP/TP1/ex7/exo7conv.cpp
@@ -0,0 +1,22 @@
+#include <iostream>
+
+int main(){
+ float a,c;
+ int b=1;
+ std::cout<< " Entrez une temperature en fahrenheit ou en celcius" << std::endl;
+ std::cin>>a;
+ std::cout<<"Est ce en fahrenheit (1) ou en celcius(2)?"<<std::endl;
+ std::cin >> b;
+ if ( b == 1) {
+ c = ( a - 32 )* (5.0/9.0);
+ std::cout<<a << " Fahrenheit vaut " << c << " Celcius"<<std::endl;
+ }
+ else if ( b == 2 ) {
+ c = 9.0/5.0 * a + 32;
+ std::cout<<a<< " Celcius vaut " << c << " Farhenheit " << std::endl;
+ }
+ else {
+ std::cout<< " Unite incorrecte"<<std::endl;
+ }
+ return 0;
+}