Given an Integer N, write a program to reverse it.
#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.