Ajout des fichiers des séances précédentes

This commit is contained in:
HORVILLE 2021-09-17 09:26:08 +02:00
parent 98cd4b3b51
commit 3947666c85
21 changed files with 1946 additions and 0 deletions

BIN
APL1.1/TP01/executable Executable file

Binary file not shown.

1822
APL1.1/TP01/intermediaire.i Normal file

File diff suppressed because it is too large Load Diff

10
APL1.1/TP01/salut.c Normal file
View File

@ -0,0 +1,10 @@
/* premier programme */
#include <stdlib.h>
#include <stdio.h>
int main(void) {
printf("Hello World!\n");
return EXIT_SUCCESS;
}

14
APL1.1/TP02/pascal.c Normal file
View File

@ -0,0 +1,14 @@
#include<stdio.h>
int main(){
unsigned char t[30][30];
int k,n;
for(n=0;n<30;n++){
for(k=0;k<=n;k++){
if (k==0||k==n) t[n][k] = 1;
else t[n][k] = (t[n-1][k] + t[n-1][k-1])%2;
putchar(t[n][k] ? '*':' ');
}
putchar('\n');
}
}

BIN
APL1.1/TP03/abientot Executable file

Binary file not shown.

10
APL1.1/TP03/abientot.c Normal file
View File

@ -0,0 +1,10 @@
/* premier programme */
#include <stdlib.h>
#include <stdio.h>
int main(void) {
printf("A bientot !\n");
return EXIT_SUCCESS;
}

BIN
APL1.1/TP03/arithmetique Executable file

Binary file not shown.

View File

@ -0,0 +1,11 @@
#include <stdlib.h>
#include <stdio.h>
#define UNE_CONSTANTE 12
int main(void) {
int une_variable = 12;
printf("constante littérale : %d\n", 12);
printf("constante nommée : %d\n", UNE_CONSTANTE);
printf("variable : %d\n", une_variable);
}

BIN
APL1.1/TP03/calcul Executable file

Binary file not shown.

15
APL1.1/TP03/calcul.c Normal file
View File

@ -0,0 +1,15 @@
#include <stdio.h>
#include <stdlib.h>
int main(void) {
printf("valeur 1 : %d\n", 100/6);
printf("valeur 2 : %d\n", 100%6);
printf("valeur 3 : %d\n", 0x1A*015);
printf("valeur 4 : %d\n", -3/5);
printf("valeur 5 : %d\n", -31%5);
printf("valeur 6 : %d\n", 100*(3/5));
printf("valeur 7 : %d\n", 100*3/5);
printf("valeur 8 : %d\n", 2-3-5);
printf("valeur 9 : %d\n", 2-(3-5));
}

BIN
APL1.1/TP03/conversions Executable file

Binary file not shown.

12
APL1.1/TP03/conversions.c Normal file
View File

@ -0,0 +1,12 @@
/* premier programme */
#include <stdlib.h>
#include <stdio.h>
#define NOMB 95
int main(void) {
printf("%d en base 10 ; %X en base 16 et %o en base 8.\n", NOMB, NOMB, NOMB);
return EXIT_SUCCESS;
}

BIN
APL1.1/TP03/conversions_2 Executable file

Binary file not shown.

View File

@ -0,0 +1,12 @@
#include <stdlib.h>
#include <stdio.h>
#define CONST_OCT 00110
#define CONST_HEX 0x48
int main(void) {
printf("0%o en décimal équivaut %d\n", CONST_OCT, CONST_OCT);
printf("0x%X en décimal équivaut %d\n", CONST_HEX, CONST_HEX);
return EXIT_SUCCESS;
}

BIN
APL1.1/TP03/exitvalues Executable file

Binary file not shown.

10
APL1.1/TP03/exitvalues.c Normal file
View File

@ -0,0 +1,10 @@
/* exit values; programme */
#include <stdlib.h>
#include <stdio.h>
int main(void) {
printf("EXIT_SUCCESS: %d ; EXIT_FAILURE: %d\n", EXIT_SUCCESS, EXIT_FAILURE);
return EXIT_SUCCESS;
}

BIN
APL1.1/TP03/limite Executable file

Binary file not shown.

8
APL1.1/TP03/limite.c Normal file
View File

@ -0,0 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
#define LIMITE 0xFFFFFFFE
int main(void) {
printf("Test : DEC: %d HEX: 0x%X OCT: 0%o\n", LIMITE, LIMITE, LIMITE);
}

10
APL1.1/TP03/salut.c Normal file
View File

@ -0,0 +1,10 @@
/* premier programme */
#include <stdlib.h>
#include <stdio.h>
int main(void) {
printf("Hello World!\n");
return EXIT_SUCCESS;
}

BIN
APL1.1/TP03/undeuxtrois Executable file

Binary file not shown.

12
APL1.1/TP03/undeuxtrois.c Normal file
View File

@ -0,0 +1,12 @@
/* troisieme programme */
#include <stdlib.h>
#include <stdio.h>
int main(void) {
printf("un\n");
printf("\tdeux\n");
printf("\t\ttrois\n");
return EXIT_SUCCESS;
}