#include
using namespace std;
int main() {
int n;
cin>>n;
cout<<endl;
int r;
while(n!=0){
r=n%10;
cout<<r;
n=n/10;
}
}
i wrote this , it is working but how do i check if reverse was calculated ? in this we are just printing number by number ,how do we check if reverse was calculated
Doubt in the question
is this the right approach ??—>>>>>#include using namespace std; int main() { int n; cin>>n; cout<<endl; int r; int rev=0; int multi=1; while(n!=0){ r=n%10; rev=r+(rev*10); n=n/10; cout<<rev<<endl; } cout<<rev; }