Files
SCR/SCR3.1/TP4/Exo1/Rebours.c
2025-09-30 13:22:20 +02:00

20 lines
341 B
C

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
int n = (int)strtol(argv[1], NULL,0);
int pid = getpid();
printf("%d: debut\n", pid);
for (int i = n; i > 0; i--) {
printf("%d: %d\n", pid, i);
sleep(1);
}
printf("%d: fin\n", pid);
return 0;
}