BUT2/DEV/DEV1.1_suite/arbre_recursif_d_ayoub_ammarrraararrara.c

25 lines
337 B
C
Raw Permalink Normal View History

2023-10-23 13:23:36 +02:00
#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;
}