I would like someone to help me correct my mistake in this program .
#include<iostream.h>
#include<conio.h>
void main();
{int r,n,Rev=0,temp;
cin>>n;
temp=n;
while(n>0)
Rev=Rev*10+n%10;
n=n/10;
if(temp==Rev)
cout<<"test is positive";
else
cout<<"test is negative";
getch();
}
Rev
means the number we get when reversing the digits.In the case of a positive test, it becomes a palindrome otherwise it does not.Temp
is the temporary variable