#include<iostream> 
      using namespace std;
      //main program
      int main ()
      {
          //variables initialization
          int num, reverse = 0, rem;
          cout <<"Enter a number: "; 
          cin >> num;
          //loop to find reverse number
          while(num != 0)
          {
            rem = num % 10;
            reverse = reverse * 10 + rem;
            num /= 10;
          };
          //output
          cout <<"Reversed Number: "<<reverse;
          return 0;
      }
      
      Cpp language logo

      reverse

      0

      0

      avatar
      Ayush Gupta

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.