Thread: Printing an array in reverse order!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    27
    Quote Originally Posted by Feengur View Post
    Because your condition is wrong.

    Code:
    for(i=0;i>=7;i--)
    notice anything wrong with that?

    If 'i' is set to zero and your condition is that it should be GREATER than or equal to '7' how will it ever run?

    should be:

    Code:
    for(i=6;i>=0;i--)
    hth,

    -Feen
    lmao, wow I feel like an idiot. XD Thanks Feen.

  2. #2
    Registered User
    Join Date
    Jan 2008
    Posts
    28
    no problem. It happens all the time!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 10-21-2005, 02:11 PM
  2. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM
  3. reverse order - arrays
    By Lillian in forum C Programming
    Replies: 12
    Last Post: 11-03-2002, 07:38 PM
  4. Printing String in reverse order
    By ling in forum C Programming
    Replies: 14
    Last Post: 10-18-2001, 09:03 AM
  5. read into array and spit out in reverse order
    By steven in forum C Programming
    Replies: 4
    Last Post: 09-07-2001, 02:27 PM