#include <stdio.h>
char str[] = "POLITEKNIK";
int strLength = sizeof(str) - 1;
void main() {
char reverse = 'x';
for (int i = 0, y = strLength; i < strLength; i++) {
for (int j = 0; j < y; j++) {
printf("%c", str[j]);
}
printf("\n");
if (reverse == 'x')
y--;
else if (reverse == 'y')
y++;
if (i == (strLength - 1) && reverse == 'x')
i = 0, reverse = 'y', y = 2;
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: