fin TP
This commit is contained in:
18
DEV1.1/TP06/exo2.c
Normal file
18
DEV1.1/TP06/exo2.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void){
|
||||
int n;
|
||||
int err;
|
||||
|
||||
printf("Entrer un entier naturel ");
|
||||
err= scanf("%d",&n);
|
||||
if ((n%3)<=1) {
|
||||
printf("le multiple le plus proche est : %d\n", (n /3)*3);
|
||||
} else {
|
||||
printf("%d\n",(n/3+1)*3);
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user