This C program asks the user to input a height and width, then uses nested for loops to print out a rectangle of asterisks (*) based on the input height and width. The outer for loop iterates from 1 to the height, printing a new line each time. The inner for loop iterates from 1 to the width, printing an asterisk on each line.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
3 views1 page
JavaScript Loop for Rectangle Output
This C program asks the user to input a height and width, then uses nested for loops to print out a rectangle of asterisks (*) based on the input height and width. The outer for loop iterates from 1 to the height, printing a new line each time. The inner for loop iterates from 1 to the width, printing an asterisk on each line.