university proyect

I have a proyect for saturday, the exercise is about a menu with 5 options.
the option number 1 concist in making an square of asterisks with a number that the user is suppost to give at the begining,and the asteriks needs to apper just in the corners of the screen making full square, for example if the user put 3 the square needs to be with the size 3x3 like this
***
* *
***
closed account (48T7M4Gy)
Excellent. Are you having problems with it? If you are show us your work so far and we'll try and help you out. :)
closed account (3voN6Up4)
I see what you have to do here, provide your code sample and show us what you're having trouble on, we wont just give you the answers my friend.
#include "stdafx.h"
#include <iostream>
#include<string>
#include<cstdlib>
using namespace std;

int main()
{
int menu = 0;
cout << "1 Primer ejercicio" << endl
<< "2 Segundo ejercicio" << endl
<< "3 Tercer ejercicio" << endl
<< "4 Cuarto ejercicio" << endl
<< "5 Salir" << endl;
cin >> menu;
if (menu == 1)
{
int n;
cout << "digite la medida del lado del cuadrado";
cin >> n;
for (int fila = 1; fila <= n; fila++)
{
for (int columna = 1; columna <= n; columna++)
{
if (fila== columna == n)
{
cout << "*" << endl;
}
else
{
cout << " " << endl;
}
}
}
}
system ("pause");
return 0;
}

btw, the excercise is in spanish because I´m from costa rica, if you don't understand something please tell me
i have troubles whit the if
if (fila== columna == n) is equivalent to if ((fila == columna) == n)

What did you mean to accomplish there?
if (int n; fila = 1 && columna = 1)

if the first line and the first colum is equal to 1, the sistem will put an *

Topic archived. No new replies allowed.