diff --git a/DEV1.1/TP01/AinASCII.c b/DEV1.1/TP01/AinASCII.c new file mode 100644 index 0000000..7d5bef0 --- /dev/null +++ b/DEV1.1/TP01/AinASCII.c @@ -0,0 +1,8 @@ +#include +#include + +int main() { + char a_letter = 'a' - 32; //32 = 2^5// + printf("%c\n", a_letter); + return 0; +} diff --git a/DEV1.1/TP01/CaractereASCII.c b/DEV1.1/TP01/CaractereASCII.c new file mode 100644 index 0000000..6f5a62b --- /dev/null +++ b/DEV1.1/TP01/CaractereASCII.c @@ -0,0 +1,7 @@ +#include +#include + +int main(void) { + char seven = '6'+1; + printf("%c\n", seven); +} diff --git a/DEV1.1/TP01/EncodageASCII.c b/DEV1.1/TP01/EncodageASCII.c new file mode 100644 index 0000000..45cb7a5 --- /dev/null +++ b/DEV1.1/TP01/EncodageASCII.c @@ -0,0 +1,7 @@ +#include +#include + +int main(void) { + printf("%c\n", 'î'); + return EXIT_SUCCESS; +} diff --git a/DEV1.1/TP01/ExtractBirth.c b/DEV1.1/TP01/ExtractBirth.c new file mode 100644 index 0000000..1c14cac --- /dev/null +++ b/DEV1.1/TP01/ExtractBirth.c @@ -0,0 +1,12 @@ +#include +#include + +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; +} diff --git a/DEV1.1/TP01/bases.c b/DEV1.1/TP01/bases.c new file mode 100644 index 0000000..afc9600 --- /dev/null +++ b/DEV1.1/TP01/bases.c @@ -0,0 +1,19 @@ +#include +#include + +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 diff --git a/DEV1.1/TP01/salut.c b/DEV1.1/TP01/salut.c new file mode 100644 index 0000000..98aea86 --- /dev/null +++ b/DEV1.1/TP01/salut.c @@ -0,0 +1,26 @@ +/* premier programme */ + +#include +#include + +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; +} + diff --git a/DEV1.1/TP02/#bases.c# b/DEV1.1/TP02/#bases.c# new file mode 100644 index 0000000..767de65 --- /dev/null +++ b/DEV1.1/TP02/#bases.c# @@ -0,0 +1,19 @@ +#include +#include + +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 \ No newline at end of file diff --git a/DEV1.1/TP02/4.c b/DEV1.1/TP02/4.c new file mode 100644 index 0000000..1988d00 --- /dev/null +++ b/DEV1.1/TP02/4.c @@ -0,0 +1,16 @@ +#include +#include + +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; +} diff --git a/DEV1.1/TP02/bases.c b/DEV1.1/TP02/bases.c new file mode 100644 index 0000000..558e53c --- /dev/null +++ b/DEV1.1/TP02/bases.c @@ -0,0 +1,9 @@ +#include +#include + +int main(void) { + printf("%d\n", 72); + printf("%d\n", 0110); + printf("%d\n", 0x48); + return EXIT_SUCCESS; +} diff --git a/DEV1.1/TP02/reponses.txt b/DEV1.1/TP02/reponses.txt new file mode 100644 index 0000000..82dda66 --- /dev/null +++ b/DEV1.1/TP02/reponses.txt @@ -0,0 +1,2 @@ +Je pense que le programme affichera : +