using namespace std;
      int reverseNumber() {
        int number, reverse = 0;
        cout << "Enter a Number to Reverse and press Enter: ";
        cin >> number;
        for(; number != 0 ;){
          reverse = reverse * 10;
          reverse = reverse + number%10;
          number = number/10;
        }
        cout << "Reversed Number is:  " << reverse;
        return 0;
      }
      
      Cpp language logo

      Reverse a number

      Codiga's C++ Recipes

      Reverse a number from input

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.