C Program
C program to Print Alphabet C star pattern
Example
#include <stdio.h>
int main()
{
int a, b;
int rows = 7;
for (a = 0; a < rows; a++)
{
for (b = 0; b < rows;b++)
{
if (a == 0 || a == rows - 1 || b == 0)
{
if ((a == 0 || a == rows - 1) && b > 4)
continue;
printf("*");
} else {
printf(" ");
}
}
printf("\n");
}
return 0;
}
No comments:
Post a Comment