22 Novembre

This commit is contained in:
Adrian POURCHOT 2022-11-22 11:27:42 +01:00
parent 62d68f4ceb
commit 1ed4aa94d6
2 changed files with 54 additions and 2 deletions

View File

@ -0,0 +1,47 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
struct complexe{
double reel;
double imag;
};
typedef struct complexe complexe;
void afficheComplexe(double x , double y){
printf("La notation algebrique de ce nombre complexe est : %lf+%lfi\n",x,y);
}
double calcModule(complexe C){
double module;
module = pow (C.reel,2)+ pow (C.imag,2);
module = pow (module,0.5);
return module;
}
complexe calcConjugue(complexe C){
complexe res;
res.reel=C.reel;
res.imag=-C.imag;
return res;
}
complexe calcInverse(complexe C){
complexe res;
res.reel=C.reel/pow(calcModule(C),2);
res.imag=C.imag/pow(calcModule(C),2);
return res;
}
int main() {
complexe C = {6,10};
afficheComplexe(C.reel , C.imag);
double moduleDeC=(calcModule(C));
printf("Le module de ce complexe est : %lf\n",moduleDeC);
complexe conjugueDeC = calcConjugue(C);
afficheComplexe(conjugueDeC.reel , conjugueDeC.imag);
complexe inverseDeC = calcInverse(C);
afficheComplexe(inverseDeC.reel , inverseDeC.imag);
return 0;
}

View File

@ -3,7 +3,12 @@
#include <grp.h>
int main() {
struct group student = getgrnam(etc/group/students22);
printf("%s",student.gr_mem);
int i = 0;
struct group etu;
etu = *getgrnam("senart22");
while (etu.gr_mem[i]!=NULL){
i++;
printf("%s",etu.gr_mem[i]);
}
return 0;
}