Hello,
I have two arrays that contain different numbers that I need to compare with another array.. e.g.
Array 1:
10
20
40
70
Array 2:
5
3
10
18
2
Basically, I want to write a program that calculates the highest value each array and then swops the values..
So like: 70 is the highest value in array 1, and 18 is the highest value of array 2 so these have to be swopped.. Here's the code:
int max = 0; int max2 = 0;
for(int i=0; (i < size); i++)
{
max = counter[0];
if(counter[i] >= max)
{
max = counter[i];
}
for(int j=0; (j < size); j++)
{
max2 = counter[0];
if(counter[j] >= max)
{
max2 = counter[j];
}
}
}
Any suggestions?