My homework goes like this:
Write a program that accepts as many integers the user wants to input. Determine the highest and lowest numbers and subtract all other numbers from the highest number.
example: numbers to be entered: 6
[The difference from the highest is:
[42-20]=22 <---how can i display them?
Logically you don't know the highest number until all the numbers have been input, so to show all the differences you will have to store all the numbers (eg in an array) as they are input. Then, when you know the largest, you can loop through the array and disaply all the differences.
Sorry, but no. I'm no going to write your homework for you. Your teacher obviously thinks that you should know enough about arrays, or are ready to learn enough, so that's what you should do. Here a good place to start: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html
It's up to you to try your best. There are plenty of people here who will help you if you do.