Previous Next
0 / 33
Module DEMO-32-60DEMO-C-32

Solid Rectangle

DEMO-C-32 • Programming in C

Browser-only practice

Problem Statement

Write a program that reads two integers R and C, and prints a solid rectangle made of asterisks (*) with R rows and C columns.

Example

If R = 3 and C = 5, the output should be:


Requirements

  • Use nested loops to generate the pattern.
  • Each row must contain exactly C asterisks.
  • There should be exactly R rows printed.

Constraints

You must use nested loops to solve this problem.

Input Format

A single line containing two space-separated integers R and C (1 ≤ R, C ≤ 20).

Output Format

Print R lines, each containing C asterisks (*).

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
3 5
*****
*****
*****
Input: 3 5
Sample #2
Public sample
5 2
**
**
**
**
**
Input: 5 2
Sample #3
Public sample
1 1
*
Input: 1 1
Sample #4
Public sample
6 8
********
********
********
********
********
********
Input: 6 8

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings