Friday, July 13, 2012

Pattern English Alphabet Z

Write a Program to output this pattern English Alphabet Z?


                              
1:  #include<stdio.h>  
2:  int main() {  
3:    int x = 5,row,col;  
4:    for(row = 0 ; row < 6 ; row++) {  
5:        for(col = 0 ; col < 6 ; col++) {  
6:            if(row == 0 || row == 5) {  
7:                printf("* ");  
8:            }  
9:            else {  
10:                if(col == x) {  
11:                  printf("* ");  
12:                }  
13:                else {  
14:                  printf(" ");  
15:                }  
16:            }  
17:         }  
18:         x--;  
19:         printf("\n");  
20:     }  
21:  }  

Output:-



Post a Comment