about arry help!!!!

This is a discussion on about arry help!!!! within the C Programming forums, part of the General Programming Boards category; hiii if i have Code: int A[4]={1,2,3,4} how can i get : 1 1,2 1,2,3 1,2,3,4 2 2,3 2,3,4 3 ...

  1. #1
    Registered User jaxlle's Avatar
    Join Date
    Nov 2006
    Posts
    9

    about arry help!!!!

    hiii
    if i have
    Code:
    int A[4]={1,2,3,4}
    how can i get :
    1
    1,2
    1,2,3
    1,2,3,4
    2
    2,3
    2,3,4
    3
    3,4

    i need 2 or 3 loops??? if you can write in code it's will be nice thnx!!

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,767
    So you have
    - one loop to decide where to start
    - one loop inside it to decide how many to print.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. size of the char arry
    By cnu_sree in forum C Programming
    Replies: 6
    Last Post: 10-23-2007, 05:16 PM
  2. Assigning Variable to arry
    By Vicked in forum Windows Programming
    Replies: 3
    Last Post: 04-13-2003, 09:09 PM
  3. Help with simple Arry encoder
    By Marcos in forum C++ Programming
    Replies: 2
    Last Post: 03-05-2003, 06:01 PM
  4. How to set default value in arry
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 02:58 PM
  5. programming with random numbers
    By xstudent in forum C Programming
    Replies: 13
    Last Post: 05-21-2002, 02:36 AM

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