answersLogoWhite

0

public class StringReverseExample

{

public static void main(String[] args)

{

int num=1001;

int n=num, rev;

while(num!=0)

{

int d=num%10;

rev= (rev*10)+d;

num=num/10;

}

System.uot.println(rev);

}

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

How do you convert a number that consist of alphabet and number in reverse order?

To reverse a number, first convert the number to a string, then reverse the string. Given your number consists of alphanumeric characters, the number must already be a string so simply reverse the string: #include<string> using std::string; string reverse (const string& s) { string str {}; for (auto c : s) str.insert (str.begin(), c); return str; } int main () { std::cout << "Enter a number: "; string s {}; std::cin >> s; std::cout << "The number in reverse is: " << reverse (s); }


How to write A Java program to print number of digits in a given number?

One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.


2 Create a Console application that gets the a number as input from the user and it should be reversed?

//This function reverse any given string, except nullstatic string Reverse(string s) {char[] temp = s.ToCharArray();Array.Reverse(temp);return new string(temp);}//The main usagestring inputString = Console.ReadLine();Console.WriteLine(Reverse(inputString));


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 java program to count the space from the given line?

.... String line = "This is example program with spaces"; String[] tokens = line.split(" "); System.out.println(tokens.length-1); .......

Related Questions

How do you convert a number that consist of alphabet and number in reverse order?

To reverse a number, first convert the number to a string, then reverse the string. Given your number consists of alphanumeric characters, the number must already be a string so simply reverse the string: #include<string> using std::string; string reverse (const string& s) { string str {}; for (auto c : s) str.insert (str.begin(), c); return str; } int main () { std::cout << "Enter a number: "; string s {}; std::cin >> s; std::cout << "The number in reverse is: " << reverse (s); }


Fox pro program to reverse the given number?

reverse programe in fox pro


How to write A Java program to print number of digits in a given number?

One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.


How do you determine if a given string is palindrome or not?

Reverse the string and compare it to the original. If they match, then it is a palindrome.


2 Create a Console application that gets the a number as input from the user and it should be reversed?

//This function reverse any given string, except nullstatic string Reverse(string s) {char[] temp = s.ToCharArray();Array.Reverse(temp);return new string(temp);}//The main usagestring inputString = Console.ReadLine();Console.WriteLine(Reverse(inputString));


Could you write a assembly language program in tasm To check whether a given number present in a sequence of given memory location containing the string to be checked in 8086?

8086 assembly language program to check wether given number is perfect or not


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)


Find out the square root for that given number using string?

Halv that given number,Make a square that has that half number as the length of a side.Stretch the string across the diagonal of the square from corner to corner.The length of the string is the square root of the given number


A C program to print the number of words from given String?

/*We can calculate this with a lot of methods I'll explain only one of them */ *str = "abcd"; // this is a input string printf("%d", strlen(str));


Write a program to reverse the given string?

Use for loop declare string array str[] and string variable l= string length of string array j=l for i=0 to i=l/2 then temp=str[i] str[i]=str[j-1] str[j-1]=temp j=j-1 now print str array it will be reversed


Write a java program to count the space from the given line?

.... String line = "This is example program with spaces"; String[] tokens = line.split(" "); System.out.println(tokens.length-1); .......


Program to generate tokens from a given expression string?

a promlem to solve an equation or a assigment

Trending Questions
How do you create a login page by using swing in Java? What are possible causes of laminar flow in a convector pipe of a radiant panel system? What is meant by a frequency response curve of an acceptor circuit? Does there need to be a trap in a shower drain that goes directly into the cement and sewer line? Why does your central air conditioner not have water draining outside? Write a simple java program using exceptions? Why are accident safety investigations performed? When a load is placed on the middle of a horizontal beam supported at each end what does the bottom part of the beam undergo? Is reader class is an abstract class? What is the hardest puzzle ever? How many hours does a Computer Software Engineer and Systems Software Engineer works? What current has negative and positive polarity? What are loaders and discuss various loading schemes with implementation of an absolute loader? Write an algorithm and draw corresponding flow chart to check whether a given string is a palindrome or not? Do you have to change the Gasket between the toilet tank and the toilet bowl? Why induction motor is called polyphase? If the two wires are made of steel wire 1.0 mm in diameter what is the percentage stretch of each because of the load? What will happen to the technology 5 years from now? If capacitors dont use ac current then how and why are they used in most appliances? What is a type of real-world writing that presents material that is necessary or valuable to the reader?