0

Ive been working on this code for a bit but cant figure out what im doing wrong, If someone could have a look Id appreciate it a lot. Thanks! heres what its suppose to do:

Write a function that displays the left margin of the screen a solid square of a
character whose side is specified in integer parameter side. For example if the
character is ‘*’ and side is 4, the function displays
****
****
****
****

#include <iostream>
#include <conio.h>

using std::cin;
using std::cout;
using std::endl;

int main ()

{
	int side;

	cout << "This program will display a solid square of asterisks whose side is specified by the user." << endl;

	cout << "Please enter an integer specifying the length of the side." << endl;
	cin >> side;

	for ( int i = 0 ; i < side ; i++)

	{
		cout << " * " << endl;


		for ( int j = 0 ; j < side -1 ; j++)

		{

			cout << " * " << endl;

		}

	}

	getch(); 
	return 0;
	

}
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Taywin
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.