Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int height;
- int row;
- int column;
- do { printf("Height (must be an odd number):\n ");
- scanf("%d", &height);
- } while (!(height%2));
- for (row = 1; row <= height; row++) {
- if (row%2) {
- for (column = 1; column <= height/2+1; column++) printf(" * ");
- printf("\n");
- }
- if (!(row%2)) {
- printf(" * ");
- printf("\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment