Welcome to Dream.In.Code
Become a C++ Expert!

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




I need help to create this design(using nested loops)

 
Reply to this topicStart new topic

I need help to create this design(using nested loops), pls help..i got xam the day afta 2moro

SPS
18 Jan, 2008 - 10:16 AM
Post #1

New D.I.C Head
*

Joined: 18 Jan, 2008
Posts: 4

I need help to create this design


1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1

pls help.....

This post has been edited by SPS: 18 Jan, 2008 - 10:23 AM
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: I Need Help To Create This Design(using Nested Loops)
18 Jan, 2008 - 10:23 AM
Post #2

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,550



Thanked: 67 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
What part are you having trouble with?

code.gif
User is offlineProfile CardPM
+Quote Post

manzoor
RE: I Need Help To Create This Design(using Nested Loops)
18 Jan, 2008 - 10:49 AM
Post #3

D.I.C Regular
Group Icon

Joined: 7 Aug, 2007
Posts: 406



Thanked: 2 times
Dream Kudos: 50
My Contributions
Post your code so that the members can help you out.
IPB Image

Thanks.

This post has been edited by manzoor: 18 Jan, 2008 - 10:51 AM
User is online!Profile CardPM
+Quote Post

SPS
RE: I Need Help To Create This Design(using Nested Loops)
19 Jan, 2008 - 12:46 AM
Post #4

New D.I.C Head
*

Joined: 18 Jan, 2008
Posts: 4

dude...i dont know how to use the loops properly to get the design.....its pretty confusing...please help
User is offlineProfile CardPM
+Quote Post

jjhaag
RE: I Need Help To Create This Design(using Nested Loops)
19 Jan, 2008 - 12:54 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
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

If you have yet to write any code for this, take a look at the C/C++ snippets, tutorials, and FAQ for inspiration, examples, and explanations of the techniques that you are required to use.

Thanks.
User is offlineProfile CardPM
+Quote Post

baavgai
RE: I Need Help To Create This Design(using Nested Loops)
19 Jan, 2008 - 06:20 AM
Post #6

Dreaming Coder
Group Icon

Joined: 16 Oct, 2007
Posts: 2,047



Thanked: 106 times
Dream Kudos: 475
Expert In: C, C++, Java, C#, ASP.NET, PHP, Perl, Python, Oracle, SQL Server, MySql, HTML, JavaScript, Lua

My Contributions
QUOTE(SPS @ 19 Jan, 2008 - 03:46 AM) *

dude...i dont know how to use the loops properly to get the design.....its pretty confusing...please help


Surely anyone who assigned this to you would have explained loops? If you really need a explanation, loops are ubiquitous, there are probably millions of examples in google.

Just in case google, somehow, isn't working for you, this is how a loop works:
CODE

#include <iostream>
using namespace std;

int main () {
    // this says, initialize a variable named i
    // and assign it the value of 1
    // if the value currently in i is less than 5, keep going
    // once the code in this block is executed, increment i by one
    // keep executing the code in the block until i fails the test, i<5
    for(int i=1; i<5; i++) {
        // print the current value of i, and a space
        cout << i << " ";
    }
    // print a new line
    cout << endl;
    return 0;
}

// produces the following output:
//1 2 3 4


Hope this helps.

User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/5/08 04:27AM

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