diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2025-09-26 12:24:19 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2025-09-26 12:24:19 +0200 |
| commit | 9cb070097ebf4692ae2bcb23e854a3e4ffdccd53 (patch) | |
| tree | c55c348daa1d1c1c34529a9d6c4e6f209f9a1a7b /semestre 3/architecture des ordinateurs/tme/tme2/exo1 | |
| parent | 7ed2d38e36518873139d5fea9b977e9ae72e7838 (diff) | |
Cours du 22 au 26 septembre
Diffstat (limited to 'semestre 3/architecture des ordinateurs/tme/tme2/exo1')
| -rw-r--r-- | semestre 3/architecture des ordinateurs/tme/tme2/exo1/q1.c | 17 | ||||
| -rw-r--r-- | semestre 3/architecture des ordinateurs/tme/tme2/exo1/q2.c | 12 |
2 files changed, 29 insertions, 0 deletions
diff --git a/semestre 3/architecture des ordinateurs/tme/tme2/exo1/q1.c b/semestre 3/architecture des ordinateurs/tme/tme2/exo1/q1.c new file mode 100644 index 0000000..83f9ece --- /dev/null +++ b/semestre 3/architecture des ordinateurs/tme/tme2/exo1/q1.c @@ -0,0 +1,17 @@ +#include <stdio.h> + +int main(){ + int i; + for(i = 0; i>= 0; i++); + printf("int\nmax: %d\nmin: %d\n\n", i-1, i); + + char j; + for(j = 0; j>= 0; j++); + printf("char\nmax: %d\nmin: %d\n\n", (char) (j-1), j); + + short k; + for(k = 0; k>= 0; k++); + printf("short\nmax: %d\nmin: %d\n\n", (short) (k-1), k); + + return 0; +} diff --git a/semestre 3/architecture des ordinateurs/tme/tme2/exo1/q2.c b/semestre 3/architecture des ordinateurs/tme/tme2/exo1/q2.c new file mode 100644 index 0000000..4350455 --- /dev/null +++ b/semestre 3/architecture des ordinateurs/tme/tme2/exo1/q2.c @@ -0,0 +1,12 @@ +#include <stdio.h> + +int main(){ + unsigned int i = 0; + i--; + printf("int\nmax: %u\nmin: %d\n\n", i, 0); + + unsigned char j = 0; + j--; + printf("char\nmax: %u\nmin: %d\n\n", (unsigned char) j, 0); + return 0; +} |
