Thread: Another one..

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Veni Vidi Vice
    Join Date
    Aug 2001
    Posts
    343
    Because you compare highestValue with an uninitialized value.
    Code:
    /* Always initialize an object or array before you use it*/
    double a[9];
    ......
    if ( a[ i ] > highestValue )
    Your logic for the program should be something like this
    • Fill array with values
    • Print them (if you want it of course)
    • Set highestValue to the first element in the array
    • loop through the array(start at the second element) and check for highest value
    • Print the highest value


    Give it another try and if something is still unclear just ask .
    Last edited by ripper079; 05-18-2003 at 04:03 PM.
    01000111011011110110111101100100 011101000110100001101001011011100110011101110011 01100100011011110110111001110100 01100011011011110110110101100101 01100101011000010111100101110011 0110100101101110 01101100011010010110011001100101
    Good things donīt come easy in life!!!

Popular pages Recent additions subscribe to a feed