need help in nested looping

This is a discussion on need help in nested looping within the C Programming forums, part of the General Programming Boards category; hi to all, i would just like to seek help to those who can help me.. thank you here is ...

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    3

    need help in nested looping

    hi to all,
    i would just like to seek help to those who can help me.. thank you
    here is the problem

    Code:
    (1)
    *****
    ****
    ***
    **
    *(1)
    (2)
    *****	*****(3)
     ****	 ***(3)
      ***     *(4)
       **    ***
        *   *****(4)
                              (5)55555
    		             4444
                                 333
                                 22
                                 1(5) 
                                 1(6)
                                 22
                                 333
                                 4444
                                 55555(6)
    
    *there are six loops in all
    so far  i have done only loop #2 can anyone help me with the other loops?
    
    #include<stdio.h>
    #include<conio.h>
    main()
    {
    int x,y;
    clrscr();
    for(x=1;x<=5;x++)
    {
    for(y=1;y<=x;y++)
    {
    gotoxy(x,y+5);
    printf("x");
    }
    }
    getch();
    }
    i dont know how to do the rest, can anyone give me an idea on how to continue?
    i need to use nested looping. thanks.
    Last edited by aljhay; 03-17-2009 at 07:54 AM.

  2. #2
    Banned
    Join Date
    Mar 2009
    Posts
    5
    Quote Originally Posted by aljhay View Post
    hi to all,
    i would just like to seek help to those who can help me.. thank you
    here is the problem

    Code:
    *****
    ****
    ***
    **
    *
    *****	*****
     ****	 ***
      ***     *
       **    ***
        *   *****
                                 55555
    		             4444
                                 333
                                 22
                                 1 
                                 1
                                 22
                                 333
                                 4444
                                 55555
    so far this is what i have done 
    
    #include<stdio.h>
    #include<conio.h>
    main()
    {
    int x,y;
    clrscr();
    for(x=1;x<=5;x++)
    {
    for(y=1;y<=x;y++)
    {
    gotoxy(x,y+5);
    printf("x");
    }
    }
    getch();
    }
    i dont know how to do the rest, can anyone give me an idea on how to continue?
    i need to use nested looping. thanks.
    Can you tell me which output you want , the star(*) program or the counting program(543212345). Please explain it clearly so that i can give you the solution.

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    3
    the out put that i want is all of these in one printing, but, the loops are different for each. wait ill re-edit the output.

  4. #4
    Registered User
    Join Date
    Mar 2009
    Posts
    3
    the out put that i want is all of these in one printing, but, the loops are different for each. wait ill re-edit the output.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Nested array vs. tree
    By KONI in forum Tech Board
    Replies: 1
    Last Post: 06-07-2007, 04:43 AM
  2. deriving classes
    By l2u in forum C++ Programming
    Replies: 12
    Last Post: 01-15-2007, 04:01 PM
  3. Problem constructing a class with a nested struc
    By pliang in forum C++ Programming
    Replies: 3
    Last Post: 04-14-2005, 07:43 PM
  4. Nested Loop with add-on Equation..?? Seems Impossible!
    By AssistMe in forum C Programming
    Replies: 3
    Last Post: 03-11-2005, 11:28 AM
  5. Nested Classes
    By manofsteel972 in forum C++ Programming
    Replies: 4
    Last Post: 11-21-2004, 10:57 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21