This commit is contained in:
2023-02-08 11:18:16 +01:00
parent 639fd8c410
commit 7021891e9c
60 changed files with 1218 additions and 0 deletions

22
DEV1.1S/TP02/complexes.c Normal file
View File

@@ -0,0 +1,22 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void){
struct crocs{
double x;
double y;
double i = sqrt(-1);
double z = x+y*i;
}
double val1;
double val2;
double res;
double eee;
printf("Donnez une valeur : ");
scanf("%f", &val1);
printf("Donnez une deuxième valeur : ");
scanf("%f", &val2);
struct crocs cars = {val1;val2;eee;res}
printf("%f", res);
return EXIT_SUCCESS;
}

14
DEV1.1S/TP02/date.c Normal file
View File

@@ -0,0 +1,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void){
time_t temps= time(NULL);
struct tm* date = localtime(&temps);
printf("%d", date->tm_year+1900);
printf("-");
printf("%d", date->tm_mon+1);
printf("-");
printf("%d\n", date->tm_mday);
return EXIT_SUCCESS;
}

14
DEV1.1S/TP02/groupe.c Normal file
View File

@@ -0,0 +1,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <grp.h>
#include <sys/types.h>
#include <string.h>
int main(void){
int i = 0;
struct group* groupe = getgrnam("students22");
while(groupe->gr_mem[i] != NULL){
printf("%s", groupe->gr_mem[i]);
i++;
}
return EXIT_SUCCESS;
}

15
DEV1.1S/TP02/tailles.c Normal file
View File

@@ -0,0 +1,15 @@
#include <stdio.h>
#include <stdlib.h>
int main(void){
struct tailles{
char* a;
char* b;
char* c;
};
struct tailles chaine = {"e","ab","c"};
int res = sizeof(chaine);
printf("%d\n", res);
return EXIT_SUCCESS;
}