Hey guys!
I have an assignment for Tuesday.
The problem is:
Write a program, getting n (odd, n>=1 && n<=15) from the user and prints this shape:
For n=3
PLZ Click here to see the image .
I wrote this code, but I don't know what to do with line #13.
I appreciate your help!
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int i,j,n;
cout << "Enter n: ";
cin >> n;
for (i=1; i<=(2*n-1) ; i++)
{
for (j=1; j<=(n-i); j++)
cout << " ";
for (j=1; j<=(2*i-1); j++)
cout << "*";
cout << "\n";
}
getch();
}