From 9fe033ea88c2f705ec18c232873d056e0c229d72 Mon Sep 17 00:00:00 2001 From: Gaspard Coulet Date: Wed, 28 Apr 2021 23:05:53 +0200 Subject: Initial commit --- sem_2/HLIN202/TP/TP5-6/ex6/exo6 | Bin 0 -> 9288 bytes sem_2/HLIN202/TP/TP5-6/ex6/exo6.cpp | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 sem_2/HLIN202/TP/TP5-6/ex6/exo6 create mode 100644 sem_2/HLIN202/TP/TP5-6/ex6/exo6.cpp (limited to 'sem_2/HLIN202/TP/TP5-6/ex6') diff --git a/sem_2/HLIN202/TP/TP5-6/ex6/exo6 b/sem_2/HLIN202/TP/TP5-6/ex6/exo6 new file mode 100644 index 0000000..991cc87 Binary files /dev/null and b/sem_2/HLIN202/TP/TP5-6/ex6/exo6 differ diff --git a/sem_2/HLIN202/TP/TP5-6/ex6/exo6.cpp b/sem_2/HLIN202/TP/TP5-6/ex6/exo6.cpp new file mode 100644 index 0000000..059404d --- /dev/null +++ b/sem_2/HLIN202/TP/TP5-6/ex6/exo6.cpp @@ -0,0 +1,20 @@ +#include + +void addima (double x, double y, double x2, double y2, double * xrslt, double * yrslt ) { + *xrslt = x + x2; + *yrslt = y + y2; +} + +void multima (double x, double y, double x2, double y2, double * xrslt, double * yrslt ) { + *xrslt = x*x2 + x*y2; + *yrslt = y*x2 + y*y2; +} + +int main () { + double x=2,y=3,x2=5,y2=1, rsltx, rslty; + addima(x,y,x2,y2,&rsltx,&rslty); + std::cout<<"(2+3i) +(5+i) = "<< rsltx <<" + " << rslty << "i"<