No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
public class W4P7{ public static void main(String []args){ int [] myArray = {11, 29, 21, 23, 33, 32}; method(myArray); }//end of main /****************start of method****************/ public static void method(int [] x) { int swap; for(int i=0; i<x.length;i++){ for(int j=0; j<x.length-1;j++){ if(x[j] > x[j+1]){ swap = x[j]; x[j]=x[j+1]; x[j+1]=swap; }//end of … |
|
Write java program to do the following: Write a METHOD to input an array of type LONG that stores the value of all the powers of 2 from 0 to 63 (i.e. 2^0 to 2^63 ) Output the contents of the array screen (what happens if you try … |
|
I'm trying to use an array to print out 6 numbers out of 42 since it's a lotto code Here's the question the lecturer wants me to do: Write a Java program to achieve the following: Declare an array of type int of size 6 Randomly generate your … |