top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Write a java function to accept a number and reverse the same?

+2 votes
275 views

Write a java function to accept a number and reverse the same. If the number ends with one or more zeroes, then in the reversed number those zeroes will not be present(since those zeroes become leading zeroes). If the input number is negative, the sign should be retained

posted Mar 29, 2016 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+2 votes

Assumption:

  • The input strings will contain only numeric digits
  • The input strings can be of any large lengths
  • The lengths of the two input string need not be the same
  • The input strings will represent only positive numbers

Example

If input strings are “1234” and “56”, the output string should be “1290”
If input strings are “56” and “1234”, the output string should be “1290”
If input strings are “123456732128989543219” and “987612673489652”, the output string should be “123457719741663032871”

+1 vote

Given a singly linked list of integers, write a function in java that returns true if the given list is palindrome, else returns false

...