Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How to reverse and add two digits in a number using Visual Basic?

For example, I have the number 86

If I click the "add" option, then the result will be 14

If I click the "reverse" option, then the result will be 68

Someone please tell me how to code this program

2 Answers

Relevance
  • 7 years ago
    Favorite Answer

    Convert the number to a string, separate the string into two smaller strings, then manipulate the two smaller strings.

    N

  • roger
    Lv 7
    7 years ago

    if you know hat it is a 2 digit number

    then

    (a Mod 10) *10 + a/10)

    should do it

    take the number modulo 10 (ones digit) multiply by ten

    and add the number divided by 10 (tens digit)

Still have questions? Get your answers by asking now.