Skip to content

Instantly share code, notes, and snippets.

@jonathan-irvin
Last active August 29, 2015 14:19
Show Gist options
  • Save jonathan-irvin/2577960123863fc8063f to your computer and use it in GitHub Desktop.
Save jonathan-irvin/2577960123863fc8063f to your computer and use it in GitHub Desktop.
Int reverse exercise
import java.util.Scanner;
public class IntReverse {
public static void main(String[] args) {
final int TOTAL_INTS = 10;
Scanner input = new Scanner(System.in);
int num[] = new int[TOTAL_INTS];
for(int i=0;i<TOTAL_INTS;i++){
System.out.print("Enter Number "+(i+1)+": ");
num[i] = input.nextInt();
}
for(int i=0;i<TOTAL_INTS;i++){
System.out.println(num[(TOTAL_INTS-1)-i]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment