answersLogoWhite

0

public static int[] reverseArray(int[] array) {

int i = 0, j = array.length - 1;

for (i = 0; i < array.length / 2; i++, j--) {

int temp = array[i];

array[i] = array[j];

array[j] = temp;

}

return array;

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

How do you write a program that outputs a given characters in reverse?

write the javascript code to display the reverse no. of given no. (e.g. 247 reverse of 742)


Write a program to implement the various operations on string such as length of string concatenation reverse of a string copy of a string to another in VB?

what is string


How do you Write a C program to reverse an Integer number.?

Reference:cprogramming-bd.com/c_page2.aspx# reverse number


Write the program in Linux to find the reverse of any string?

i am sam


Write a program to read your name and reverse it using arrays?

abdulrahman


Can you write a program without main in c?

Certainly, you can write a program without main, but you cannot build an executable from it, if that is okay with you.


Write a c program on reverse the diagonal element of matrix?

mano ni anda yarrr


How do we write c program without using swap to interchange values by accessing another variable?

int a,b; a=a+b; b=a-b; a=a-b; that's it simple


Can you write hello world without operating system?

Yes, you can write a &quot;hello world&quot; program without an operating system using bare metal programming. This involves directly interfacing with the hardware of a computer system without an intermediary operating system. The program can be written to access and output text to a display device without the need for an OS.


Can you write a program without specifying the prototype of any function?

You can write a program without specifying its prototype when the function returns an integer.If the prototype is not mentioned the compiler thinks that the return type of the function used is integer.When making program which return integer you can ignore writing the protoype.


How do you Write a program in 'c' language which accepts int numbers from the users print its reverse number x function which return value?

question clarity


Write a Program to convert decimal number into hexadecimal no without using function and string?

This is not a question.