Ajout des fichiers des séances précédentes
This commit is contained in:
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
|
||||
Reference in New Issue
Block a user