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

This commit is contained in:
Bekkouche Anis 2024-09-10 14:36:09 +02:00
parent 56de62dd74
commit f575c21e88
10 changed files with 125 additions and 0 deletions

8
DEV1.1/TP01/AinASCII.c Normal file
View File

@ -0,0 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
int main() {
char a_letter = 'a' - 32; //32 = 2^5//
printf("%c\n", a_letter);
return 0;
}

View File

@ -0,0 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char seven = '6'+1;
printf("%c\n", seven);
}

View File

@ -0,0 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
int main(void) {
printf("%c\n", 'î');
return EXIT_SUCCESS;
}

View File

@ -0,0 +1,12 @@
#include <stdio.h>
#include <stdlib.h>
int main() {
printf("Veuillez entrer le 2e, 3e, 4e et 5e numéro indiqué sur votre numéro de sécurité sociale dans le bonne ordre.\n");
char year1 = getchar();
char year2 = getchar();
char month1 = getchar();
char month2 = getchar();
printf("Vous êtes né le %c%c/%c%c\n", month1, month2, year1, year2);
return 0;
}

19
DEV1.1/TP01/bases.c Normal file
View File

@ -0,0 +1,19 @@
#include <stdio.h>
#include <stdlib.h>
int main(void) {
printf("%d\n", 72);
printf("%d\n", 0110);
printf("%d\n", 0x48);
return EXIT_SUCCESS;
}
01001
10
11
12
13
14
15

26
DEV1.1/TP01/salut.c Normal file
View File

@ -0,0 +1,26 @@
/* premier programme */
#include <stdlib.h>
#include <stdio.h>
int main(void) {
char lettre1 = 'H';
char lettre2 = 'e';
char lettre3 = 'l';
char lettre4 = 'l';
char lettre5 = 'o';
char lettre6 = ' ';
char lettre7 = 'W';
char lettre8 = 'o';
char lettre9 = 'r';
char lettre10 = 'l';
char lettre11 = 'd';
char lettre12 = ' ';
char lettre13 = ':';
char lettre14 = ')';
char lettre15 = ')';
char lettre16 = ')';
printf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", lettre1, lettre2, lettre3,lettre4, lettre5, lettre6 ,lettre7, lettre8, lettre9, lettre10, lettre11, lettre12, lettre13, lettre14, lettre15, lettre16);
return EXIT_SUCCESS;
}

19
DEV1.1/TP02/#bases.c# Normal file
View File

@ -0,0 +1,19 @@
#include <stdio.h>
#include <stdlib.h>
int main(void) {
printf("%d\n", 72);
printf("%d\n", 0110);
printf("%d\n", 0x48);
return EXIT_SUCCESS;
}
01001
10
11
12
13
14
15

16
DEV1.1/TP02/4.c Normal file
View File

@ -0,0 +1,16 @@
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int n = 12;
printf(%d, (n>>7)&1);
printf(%d, (n>>6)&1);
printf(%d, (n>>5)&1);
printf(%d, (n>>4)&1);
printf(%d, (n>>3)&1);
printf(%d, (n>>2)&1);
printf(%d, (n>>1)&1);
printf(%d, n&1);
printf(\n);
return EXIT_SUCESS;
}

9
DEV1.1/TP02/bases.c Normal file
View File

@ -0,0 +1,9 @@
#include <stdio.h>
#include <stdlib.h>
int main(void) {
printf("%d\n", 72);
printf("%d\n", 0110);
printf("%d\n", 0x48);
return EXIT_SUCCESS;
}

2
DEV1.1/TP02/reponses.txt Normal file
View File

@ -0,0 +1,2 @@
Je pense que le programme affichera :