Created
April 28, 2022 18:22
-
-
Save indriApollo/26e1cece3c55cf94840040debeaf6c73 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void print_triangle(unsigned char width) | |
{ | |
unsigned char rows = (width + 1) / 2; | |
for (unsigned char i = 0; i < rows; i++) | |
{ | |
for(unsigned char j = 0; j < rows-i-1; j++) | |
{ | |
printf(" "); | |
} | |
for(unsigned char k = 0; k < (i*2)+1; k++) | |
{ | |
printf("0"); | |
} | |
printf("\n"); | |
} | |
printf("\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment