I was trying to solve project Euler problem 4 which is:
A palindromic number reads the same both ways. The largest palindrome made from the product of tw
#include
using namespace std;
int reverse(int a){
int reverse=0;
for(int i=0;i<6;i++){
reverse = reverse*10+a%10;
a/=10;
}
return reverse;
}
int main(){
int a=999,max=1,rev;;
int b=999;
for(a=999;a>100;a--){
for(b=999;b>100;b--){
int p = a*b;
rev = reverse(p);
if (p==rev) {
if(max