diff --git a/patterns/Z_pattern.c b/patterns/Z_pattern.c new file mode 100644 index 0000000..ffadd35 --- /dev/null +++ b/patterns/Z_pattern.c @@ -0,0 +1,25 @@ +/* + enter the no of rows:5 +***** + * + * +* +***** */ +#include +void main() +{ + int i,j,row; + printf("\n enter the no of rows:"); + scanf("%d",&row); + for( i=1;i<=row;i++) + { + for( j=1;j<=row;j++) + { + if(i==1 || i==row||i+j==row||i+j==row) + printf("*"); + else + printf(" "); + } + printf("\n"); + } +}