diff options
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; +} |
