CodesC/TP6/marche.c

16 lines
151 B
C

#include <stdio.h>
#include <stdlib.h>
int main()
{
int x = 0;
while ( x <= 20 && x >= -20){
x += rand()%3 - 1 ;
printf("%d \n",x);
}
}