BUT2/DEV/DEV1.1_suite/arbre_recursif_d_ayoub_ammarrraararrara.c
2023-10-23 13:23:36 +02:00

25 lines
337 B
C

#include <stdio.h>
void draw_tree(int height)
{
if (height == 0)
return;
for (int i = 0; i < height; i++)
printf(" ");
printf("|\n");
draw_tree(height - 1);
}
int main()
{
int height;
printf("Enter the height of the tree: ");
scanf("%d", &height);
draw_tree(height);
return 0;
}