Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void drawShape(int row, int col);
- int main()
- {
- int row;
- printf("Enter # of rows\n");
- scanf("%d", &row);
- drawShape(row, row);
- return 0;
- }
- void drawShape(int row, int col) {
- for(int i = 0; i < row; i++) {
- for(int j = 0; j < col; j++) {
- if(i == j) {
- printf("*");
- } else {
- printf(" ");
- }
- }
- printf("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement