Given an Integer N, write a program to reverse it.

 

Given an Integer N, write a program to reverse it.






OURSHOPKEEPER








#include <iostream> 
using namespace std;
 int main(){
      int n, t;
      cin>>t;
      while(t--){
          int digit=0, u=0;
       cin>>n;
       while(n>0){
           digit= n%10;
            n= n/10;
            u= u*10 +digit;
       }
          cout<<u;
    
       cout<<"\n";
      }
 }




    


Click on the above button to download the code.



Post a Comment

If you have furthur QUERIES please let us know

Previous Post Next Post