Last active
August 29, 2015 14:19
-
-
Save jonathan-irvin/2577960123863fc8063f to your computer and use it in GitHub Desktop.
Int reverse exercise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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