DEV/DEV1.1/TP05/division.c
2022-10-04 17:30:38 +02:00

18 lines
304 B
C

#include <stdio.h>
#include <stdlib.h>
int main(void){
int x = 0;
int y = 0;
int z = 0;
printf("Rentrer un entier >= 0: ");
scanf("%d",&x);
printf("Rentrer un entier > 0: ");
scanf("%d",&y);
while (x > y) {
z++;
x=x-y;
}
printf("%d = %d x %d + %d",((y*z)+x),y,z,x);
return EXIT_SUCCESS;
}