C Program
C program to Print A star pattern Asterisks pattern
Example:-
#include <stdio.h>
int main() {
int no = 7;
int i, j;
for (i = 0; i < no; i++)
{
for (j = 0; j <= no; j++)
{
if ((j == 0 || j == no) && i != 0 || (i == 0 && j > 0 && j < no) ||
(i == no / 2))
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
return 0;
}
C program to Print A star pattern Asterisks pattern
Output :-
No comments:
Post a Comment