Users browsing this thread: 1 Guest(s)
Some programming help?
#1
Yeah I have a Java programming online course, I've been doing decent but now we're at Arrays and I'm starting to get confused.

Anyway I need help figuring out the value of the num array with this program. I think I have an idea but I'm not sure. Take a look.

public class QuestionTwo
{
public static void main(String args [])
{
int [] num= {20,50,10,70,40,80,30,90,60};
int t=0;

for (int i=0; i<num.length; i++)
{
for (int j=i+1; j<num.length; j++)
if (num[i]>num[j])
{
t=num[i];
num[i]=num[j];
num[j]=t;
}
}

}
}



Thanked by:


Messages In This Thread
Some programming help? - by Koopaul - 06-20-2011, 10:46 PM
RE: Some programming help? - by Barubary - 06-21-2011, 03:56 AM
RE: Some programming help? - by Koopaul - 06-21-2011, 04:39 PM
RE: Some programming help? - by Barubary - 06-22-2011, 04:25 AM
RE: Some programming help? - by Work Polo Shirts - 07-15-2011, 10:25 PM

Forum Jump: