Files
DEV/DEV1.1/TP06/triple.c
T
2026-10-20 16:04:38 +02:00

14 lines
298 B
C

#include <stdio.h>
#include <stdlib.h>
int main(void) {
int n;
printf("Veuillez entrer un entier naturel : \n");
scanf("%i", &n);
int reste = n % 3;
int plus_proche = (reste == 0) ? n : (reste == 1) ? n - 1 : n + 1;
printf("%i\n", plus_proche);
return EXIT_SUCCESS;
}