answersLogoWhite

0

The following codes only applied to unsigned integers:

public int Reverse(int inputNumber) {

string inputString = inputNumber.ToString();

string reversed = StringUtil.Reverse(inputString);

return int.Parse(reversed);

}

public class StringUtil {

// returns a reversed string from the given one

public static string Reserve(string originalString) {

StringBuilder sb = new StringBuilder();

char[] charArray = originalString.ToCharArray();

for (int i = charArray.Length - 1; i >= 0; i--) {

sb.Append(charArray[i]);

}

return sb.ToString();

}

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you know that a numeric is palindrome or not using c or pascal language?

Reverse the digits then check of the new number is the same as the original number.


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); }


What are the notes for the c sharp harmonic scale?

C sharp, D sharp, E natural, F sharp, G sharp, A natural, B sharp & C sharp We call the note C "B sharp" to avoid using the same letter name twice. If we used the note name "C" we would have 2 C-notes and no B-notes in the scale!


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

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


What about multithreading in c sharp?

Multi-threading in c sharp is a system with different tutorial. Like: interaction between threads, producer, using thread pool and using mutex objects.


What major key has the most number of sharps?

The major key with the most sharps is C-sharp major, which has seven sharps. The sharps in this key are F-sharp, C-sharp, G-sharp, D-sharp, A-sharp, E-sharp, and B-sharp. C-sharp major is often considered challenging for performers due to the complexity of its key signature.


Why is there no B sharp in music theory?

In music theory, there is no B sharp because it is enharmonically equivalent to the note C. This means that B sharp and C sound the same pitch, so using B sharp would be redundant.


Count characters in an input string using c sharp?

Console.WriteLine("Please input a string:"); string str = Console.ReadLine(); Console.WriteLine("Number of characters: " + str.Length);


What are the notes to?

A sharp G G E sharp G E sharp A sharp A sharp C C A sharp C E sharp G A G E sharp A sharp A sharp A sharp G E sharp C this is not on the Flute btw idk what instrument its on


What major key has 7 sharps?

The major key that has 7 sharps is C-sharp major. In this key, the sharps are F-sharp, C-sharp, G-sharp, D-sharp, A-sharp, E-sharp, and B-sharp. It is often considered one of the more challenging keys for musicians due to the number of sharps.


What are the notes to fireflies?

A sharp G G E sharp G E sharp A sharp A sharp C C A sharp C E sharp G A G E sharp A sharp A sharp A sharp G E sharp C this is not on the flute btw idk what instrument its on


How do you play Simpson theme on keyboard?

here it is C,E,F SHARP,A,G,E,C,A,F SHARP,F SHARP,F SHARP,G,A SHARP,C,C,C,C