Ajout des fichiers des séances précédentes
This commit is contained in:
10
DEV1.1/TP01/salut.c
Normal file
10
DEV1.1/TP01/salut.c
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
/* premier programme */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
printf("Hello World!\n");
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
BIN
DEV1.1/TP02/arithmetique
Executable file
BIN
DEV1.1/TP02/arithmetique
Executable file
Binary file not shown.
16
DEV1.1/TP02/arithmetique.c
Normal file
16
DEV1.1/TP02/arithmetique.c
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
printf("%d\n", 100/6);
|
||||||
|
printf("%d\n", 100%6);
|
||||||
|
printf("%d\n", 0x1A*015);
|
||||||
|
printf("%d\n", -3/5);
|
||||||
|
printf("%d\n", -31/5);
|
||||||
|
printf("%d\n", -31%5);
|
||||||
|
printf("%d\n", 100*(3/5));
|
||||||
|
printf("%d\n", 100*3/5);
|
||||||
|
printf("%d\n", 2-3-5);
|
||||||
|
printf("%d\n", 2-(3-5));
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
BIN
DEV1.1/TP02/bases
Executable file
BIN
DEV1.1/TP02/bases
Executable file
Binary file not shown.
9
DEV1.1/TP02/bases.c
Normal file
9
DEV1.1/TP02/bases.c
Normal 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;
|
||||||
|
}
|
||||||
BIN
DEV1.1/TP02/bit
Executable file
BIN
DEV1.1/TP02/bit
Executable file
Binary file not shown.
41
DEV1.1/TP02/bit.c
Normal file
41
DEV1.1/TP02/bit.c
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
long int n = 1431655765; /*ou 0x55555555*/
|
||||||
|
|
||||||
|
printf("%d", (n>>31)&1);
|
||||||
|
printf("%d", (n>>30)&1);
|
||||||
|
printf("%d", (n>>29)&1);
|
||||||
|
printf("%d", (n>>28)&1);
|
||||||
|
printf("%d", (n>>27)&1);
|
||||||
|
printf("%d", (n>>26)&1);
|
||||||
|
printf("%d", (n>>25)&1);
|
||||||
|
printf("%d", (n>>24)&1);
|
||||||
|
printf("%d", (n>>23)&1);
|
||||||
|
printf("%d", (n>>22)&1);
|
||||||
|
printf("%d", (n>>21)&1);
|
||||||
|
printf("%d", (n>>20)&1);
|
||||||
|
printf("%d", (n>>19)&1);
|
||||||
|
printf("%d", (n>>18)&1);
|
||||||
|
printf("%d", (n>>17)&1);
|
||||||
|
printf("%d", (n>>16)&1);
|
||||||
|
printf("%d", (n>>15)&1);
|
||||||
|
printf("%d", (n>>14)&1);
|
||||||
|
printf("%d", (n>>13)&1);
|
||||||
|
printf("%d", (n>>12)&1);
|
||||||
|
printf("%d", (n>>11)&1);
|
||||||
|
printf("%d", (n>>10)&1);
|
||||||
|
printf("%d", (n>>9)&1);
|
||||||
|
printf("%d", (n>>8)&1);
|
||||||
|
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_SUCCESS;
|
||||||
|
}
|
||||||
BIN
DEV1.1/TP02/limite
Executable file
BIN
DEV1.1/TP02/limite
Executable file
Binary file not shown.
9
DEV1.1/TP02/limite.c
Normal file
9
DEV1.1/TP02/limite.c
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
printf("%d\n", 1000000);
|
||||||
|
printf("%o\n", 1000000);
|
||||||
|
printf("%x\n", 1000000);
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
BIN
DEV1.1/TP02/multiplication
Executable file
BIN
DEV1.1/TP02/multiplication
Executable file
Binary file not shown.
7
DEV1.1/TP02/multiplication.c
Normal file
7
DEV1.1/TP02/multiplication.c
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
printf("%d\n", 73 << 4);
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
10
DEV1.1/TP02/reponses.txt
Normal file
10
DEV1.1/TP02/reponses.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
16
|
||||||
|
4
|
||||||
|
338
|
||||||
|
0
|
||||||
|
-6
|
||||||
|
-1
|
||||||
|
0
|
||||||
|
60
|
||||||
|
-6
|
||||||
|
4
|
||||||
BIN
DEV1.1/TP03/Salut
Executable file
BIN
DEV1.1/TP03/Salut
Executable file
Binary file not shown.
22
DEV1.1/TP03/Salut.c
Normal file
22
DEV1.1/TP03/Salut.c
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/* premier programme */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
char l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,excla;
|
||||||
|
l1='H';
|
||||||
|
l2='e';
|
||||||
|
l3='l';
|
||||||
|
l4='l';
|
||||||
|
l5='o';
|
||||||
|
l6='W';
|
||||||
|
l7='o';
|
||||||
|
l8='r';
|
||||||
|
l9='l';
|
||||||
|
l10='d';
|
||||||
|
excla='!';
|
||||||
|
printf("%c%c%c%c%c %c%c%c%c%c %C\n",l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,excla);
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
BIN
DEV1.1/TP03/chiffre
Executable file
BIN
DEV1.1/TP03/chiffre
Executable file
Binary file not shown.
11
DEV1.1/TP03/chiffre.c
Normal file
11
DEV1.1/TP03/chiffre.c
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/* premier programme */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
char val='8';
|
||||||
|
val=val-1;
|
||||||
|
printf("%c\n",val);
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
BIN
DEV1.1/TP03/encodage1
Executable file
BIN
DEV1.1/TP03/encodage1
Executable file
Binary file not shown.
10
DEV1.1/TP03/encodage1.c
Normal file
10
DEV1.1/TP03/encodage1.c
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
/* premier programme */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
printf("Unicode : %c%c\n", '\xC3', '\xAE');
|
||||||
|
printf("Latin 1 : %c\n", '\xEE');
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
BIN
DEV1.1/TP03/encodage2
Executable file
BIN
DEV1.1/TP03/encodage2
Executable file
Binary file not shown.
9
DEV1.1/TP03/encodage2.c
Normal file
9
DEV1.1/TP03/encodage2.c
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* premier programme */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
printf("%c\n", 'î');
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
BIN
DEV1.1/TP03/extraction
Executable file
BIN
DEV1.1/TP03/extraction
Executable file
Binary file not shown.
18
DEV1.1/TP03/extraction.c
Normal file
18
DEV1.1/TP03/extraction.c
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/* premier programme */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
char c1,c2,c3,c4;
|
||||||
|
printf("Quelle est votre numéro de sécurité ?\n");
|
||||||
|
getchar();
|
||||||
|
getchar();
|
||||||
|
c1=getchar();
|
||||||
|
c2=getchar();
|
||||||
|
getchar();
|
||||||
|
c3=getchar();
|
||||||
|
c4=getchar();
|
||||||
|
printf("%c%c/%c%c\n",c3,c4,c1,c2);
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
BIN
DEV1.1/TP03/lettre
Executable file
BIN
DEV1.1/TP03/lettre
Executable file
Binary file not shown.
11
DEV1.1/TP03/lettre.c
Normal file
11
DEV1.1/TP03/lettre.c
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/* premier programme */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
char lettre='a';
|
||||||
|
lettre=lettre-32;
|
||||||
|
printf("%c\n",lettre);
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user