Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Program in C that seeks and memorize two maximums in an array

Status
Not open for further replies.

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
 

Re: help C

Search for binary search programs on Google.
 

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

Thats cool for a start!
 

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;
}


First, you need to set max1_index, otherwise you can't say if (array > max1_index)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top