Mar 4, 2008 #1 M Mejdi_tn Junior Member level 3 Joined Oct 20, 2007 Messages 28 Helped 7 Reputation 14 Reaction score 6 Trophy points 1,283 Activity points 1,473 hi i need programm that seeks two maximum in a array and memorise there position thing you
Mar 5, 2008 #2 K kiprono Advanced Member level 4 Joined Nov 18, 2005 Messages 114 Helped 19 Reputation 38 Reaction score 4 Trophy points 1,298 Location Nairobi Activity points 1,838 Re: help C Search for binary search programs on Google.
Mar 7, 2008 #3 W wtl Newbie level 4 Joined Feb 15, 2008 Messages 7 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,319 Re: help C Maybe this can help: http://www.thescripts.com/forum/thread216170.html
Mar 7, 2008 #4 J jhbbunch Full Member level 4 Joined Feb 21, 2006 Messages 197 Helped 17 Reputation 34 Reaction score 3 Trophy points 1,298 Activity points 2,902 Re: help C Is this what you mean?: for (i = 0; i > arraylength; i++) { if (array > max1_index) { temp = max1_index; max1_index= i; max2_index = temp; } else if (array > max2_index) max2_index = i; }
Re: help C Is this what you mean?: for (i = 0; i > arraylength; i++) { if (array > max1_index) { temp = max1_index; max1_index= i; max2_index = temp; } else if (array > max2_index) max2_index = i; }
Mar 8, 2008 #5 K kiprono Advanced Member level 4 Joined Nov 18, 2005 Messages 114 Helped 19 Reputation 38 Reaction score 4 Trophy points 1,298 Location Nairobi Activity points 1,838 Re: help C Thats cool for a start!
Apr 30, 2008 #6 M mmelek1 Member level 4 Joined Apr 20, 2002 Messages 70 Helped 4 Reputation 8 Reaction score 1 Trophy points 1,288 Activity points 236 Re: help C jhbbunch said: Is this what you mean?: for (i = 0; i > arraylength; i++) { if (array > max1_index) { temp = max1_index; max1_index= i; max2_index = temp; } else if (array > max2_index) max2_index = i; } Click to expand... First, you need to set max1_index, otherwise you can't say if (array > max1_index)
Re: help C jhbbunch said: Is this what you mean?: for (i = 0; i > arraylength; i++) { if (array > max1_index) { temp = max1_index; max1_index= i; max2_index = temp; } else if (array > max2_index) max2_index = i; } Click to expand... First, you need to set max1_index, otherwise you can't say if (array > max1_index)