C program to Print Alphabet T star pattern
C program to Print Alphabet T star pattern
Example
#include <stdio.h>
int main() {
int a, b;
int n = 7; // height of the T
for (a = 0; a < n; a++) {
for (b = 0; b< n; b++) {
// Print * for the top bar and vertical middle bar
if (a == 0 || b == n / 2)
printf("*");
else
printf(" ");
}
printf("\n");
}
return 0;
}