Thread: about arry help!!!!

  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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    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.

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, 04:16 PM
  2. Assigning Variable to arry
    By Vicked in forum Windows Programming
    Replies: 3
    Last Post: 04-13-2003, 08: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, 01:58 PM
  5. programming with random numbers
    By xstudent in forum C Programming
    Replies: 13
    Last Post: 05-21-2002, 01:36 AM