Advertisement
Realratnadwip

Simple Star Rectangle Print

Jun 4th, 2025
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | Source Code | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void main()
  5. {
  6.     int row, col, i, j;
  7.  
  8.     printf("This is a simple program to print a rectangle star pattern.\n\n");
  9.     printf("Enter number of rows : ");
  10.     scanf("%d", &row);
  11.     printf("Enter number of columns : ");
  12.     scanf("%d", &col);
  13.  
  14.     for(i = 1; i <= row; i++)
  15.     {
  16.         for(j = 1; j <= col; j++)
  17.         {
  18.             printf("*");
  19.         }
  20.         printf("\n");
  21.     }
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement