Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   Array (http://www.go4expert.com/forums/array-t19802/)

IT student 18Oct2009 10:14

Array
 
Hello every one
I am IT student and I hava aquesion I hop any one help me to solve it
a quesion is
  • Write a java program to:
    • Read N numbers
    • SWAP two numbers in the array .
    • INSERT a value into the array.
    • DELETE a value from the array.

SyferZookie 6Nov2009 07:13

Re: Array
 
i can help you but can you please clear the things you wanna ask...
because its not clear for me

checho 30Dec2009 15:52

Re: Array
 
1. to read the numbers use -
Scanner input = new Scanner (System.in);
int number = input.nextInt()
2. to swap a number u should make something like
int a = 0;
a = arr[i]
arr[i] = arr[i+1] // instead ot i u can put any number of element u want to switch
arr[i+1] = a
3. iam not very sure:
arr[i] = whatever value u want
4. i dont know :)


All times are GMT +5.5. The time now is 13:12.