22 lines
389 B
C
22 lines
389 B
C
|
#include <stdlib.h>
|
||
|
#include <stdio.h>
|
||
|
int main(void)
|
||
|
{
|
||
|
int entier;
|
||
|
int n;
|
||
|
|
||
|
printf("Entrez un entier naturel :\n");
|
||
|
scanf("%d", &entier);
|
||
|
|
||
|
if (entier % 3 == 0)
|
||
|
{
|
||
|
printf("Multiple de 3 : %d\n", entier);
|
||
|
}
|
||
|
if (entier % 3 == 2)
|
||
|
{
|
||
|
printf("Multiple de 3 le plus proche : %d\n", entier + 1);
|
||
|
}
|
||
|
if (entier % 3 == 1)
|
||
|
printf("Multiple de 3 : %d\n", entier - 1);
|
||
|
}
|