Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void main()
- {
- int row, col, i, j;
- printf("This is a simple program to print a hollow rectangle star pattern.\n\n");
- printf("Enter number of rows : ");
- scanf("%d", &row);
- printf("Enter number of columns : ");
- scanf("%d", &col);
- for(i = 1; i <= row; i++)
- {
- for(j = 1; j <= col; j++)
- {
- if(i == 1 || i == row || j == 1 || j == col)
- {
- printf("*");
- }
- else
- {
- printf(" ");
- }
- }
- printf("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement