Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,094 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,598 people online right now. Registration is fast and FREE... Join Now!




Help with pattern please

 
Reply to this topicStart new topic

Help with pattern please, I need to build a program that displays a patter but I cant get it to

ahsesino
16 Oct, 2007 - 10:00 AM
Post #1

New D.I.C Head
*

Joined: 15 Oct, 2007
Posts: 10


My Contributions
blink.gif


#include <iostream >
using namespace std;

void displayStars(int = 12, int = 12);

int main()
{

displayStars(12,12);
return 0;
}

void displayStars(int cols, int rows)
{
for (int down = 0; down < rows; down++)
{
for (int across = 0; across < cols; across++)
cout << "*";
cout << endl;
}
}


This is what the pattern should look like:

*
**
***
****
*****
******
******
*****
****
***
**
*

Can some one help me please

User is offlineProfile CardPM
+Quote Post

PennyBoki
RE: Help With Pattern Please
16 Oct, 2007 - 10:32 AM
Post #2

system("revolution");
Group Icon

Joined: 11 Dec, 2006
Posts: 2,009



Thanked: 5 times
Dream Kudos: 500
Expert In: Java,C++,C

My Contributions
try to play with the condition in the second for loop, yes just play around and run it, and in the first for loop right make this cout<<endl;
User is offlineProfile CardPM
+Quote Post

jjhaag
RE: Help With Pattern Please
16 Oct, 2007 - 10:34 AM
Post #3

me editor am smartastic
Group Icon

Joined: 18 Sep, 2007
Posts: 1,789



Thanked: 2 times
Dream Kudos: 775
Expert In: C,C++

My Contributions
This question has been addressed a bunch of times on this forum. Please search before making a new post (since you have to agree that this is the case to actually make the post anyway).

There is a very current thread dealing with this problem:
http://www.dreamincode.net/forums/showtopic35436.htm

-jjh
User is offlineProfile CardPM
+Quote Post

ahsesino
RE: Help With Pattern Please
16 Oct, 2007 - 10:56 AM
Post #4

New D.I.C Head
*

Joined: 15 Oct, 2007
Posts: 10


My Contributions
QUOTE(jjhaag @ 16 Oct, 2007 - 11:34 AM) *

This question has been addressed a bunch of times on this forum. Please search before making a new post (since you have to agree that this is the case to actually make the post anyway).

There is a very current thread dealing with this problem:
http://www.dreamincode.net/forums/showtopic35436.htm

-jjh


Sorry about that I had problems with my connection yesterday I thougth it didnt get posted. Sorry for the inconvenience .
User is offlineProfile CardPM
+Quote Post

jjhaag
RE: Help With Pattern Please
16 Oct, 2007 - 11:00 AM
Post #5

me editor am smartastic
Group Icon

Joined: 18 Sep, 2007
Posts: 1,789



Thanked: 2 times
Dream Kudos: 775
Expert In: C,C++

My Contributions
Oh yeah, that was YOUR post biggrin.gif . Whoops, sorry if I sounded like a dick with that response. And glad you got it working.

-jjh
User is offlineProfile CardPM
+Quote Post

ahsesino
RE: Help With Pattern Please
16 Oct, 2007 - 11:06 AM
Post #6

New D.I.C Head
*

Joined: 15 Oct, 2007
Posts: 10


My Contributions
QUOTE(jjhaag @ 16 Oct, 2007 - 12:00 PM) *

Oh yeah, that was YOUR post biggrin.gif . Whoops, sorry if I sounded like a dick with that response. And glad you got it working.

-jjh


NP thanx fo rthe help icon_up.gif
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 08:22PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month