answersLogoWhite

0

do something like this

char[] myArr = {'a','b'};

StringBuilder sb = new StringBuilder();

sb.reverse();

char[] charArr = sb.toString().toCharArray();

or something like this

char[] charArr = new char[myarr.length];

for (int i=myarr.length-1,j=0;i>=0;i++,j++){

charArr[j] = myarr[i];

}

User Avatar

Wiki User

15y 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


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

mano ni anda yarrr


How do I write a program to do the following... Write a VBA code to take the TippingBucketData.txt file and process it to generate an output file.?

Without knowing the contents of the TippingBucketData.txt file nor how to process it, it would be impossible to say how such a program would be written.


Write a program to list the contents of directory subdirectory?

mere ko batao yaar mere ko to khud ko ne pta


Why does a computer do a mini dump?

Usually, a 'mini-dump' occurs when a computer encounters an error in a program. This causes the computer to write the contents of the memory to disc. This is so the user can (if they wish) report the error and forward the contents of the mini-dump to the program vendor - so their technical team can see what happened, and if necessary re-write the software to cure the problem.


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


How to write a program in python to print the reverse of a number?

In python, type the following into a document. NOTE: Sentences following a # symbol are comments, and are not necessary for the program to run. #!/usr/bin/python #This program takes a input from a user and reverses it. number = input("Type a number: ") #This takes input from a user. a = len(number) #This finds the length of the number reverse = "" #This sets the variable reverse to an empty string. for i in number: a = a-1 #The places in a string start from 0. The last value will be the length minus 1.reverse = reverse + number[a] #Makes the number's last digit the new string's first. print("The reverse of", number, "is", reverse + ".") #prints the resulting string. This program will take any sequence of characters and reverse them. The final value is a string, but if an integer is needed, one needs only to add the line reverse = int(reverse) above the print statement. However, this will stop the program from being able to reverse strings, as it is not possible to convert a string to an integer if it is not a number.


How you write a program in c plus plus to print plaindromic numbers from 1 to n?

To check if a number is a palindrome, reverse the number and see if it is equal to the original number. If so, the number is a palindrome, otherwise it is not. To reverse a number, use the following function: int reverse(int num, int base=10) { int reverse=0; while( num ) { reverse*=base; reverse+=num%base; num/=base; } return(reverse); }