C program
C program to Print Alphabet I star pattern
Example
#include <stdio.h>
int main() {
int a, b;
int n = 7;
// print of the I
for (a = 0; a < n; a++) {
for (b = 0; b < n; b++) {
// Print * for the top, middle, and bottom rows
// or the vertical column in the middle
if (b == n / 2 || a == 0 || a == n - 1) {
printf("*");
}
else
{
printf(" ");
}
}
printf("\n");
}
return 0;
}
No comments:
Post a Comment