C Online Compiler
Example: Solid Rectangle (Fixed Size) in C
C
C++
C#
Java
Python
PHP
main.c
STDIN
Run
// Solid Rectangle (Fixed Size) #include <stdio.h> int main() { // Step 1: Define rectangle dimensions int numRows = 5; int numCols = 10; // Step 2: Outer loop for rows for (int i = 0; i < numRows; i++) { // Step 3: Inner loop for columns for (int j = 0; j < numCols; j++) { printf("*"); // Print asterisk for each column } printf("\n"); // Move to the next line after each row } return 0; }
Output
Clear
ADVERTISEMENTS