Problem Statement:A palindromic number reads the same both ways. The largest palindrome  made from the product of two 2-digit numbers is 9009 = 91  99.Find the largest palindrome made from the product of two 3-digit  numbers.This code is in C++ 11, please review my code.#include <iostream>#include <math.h>using namespace std;int palindrom(int num);int main(){    auto n1 = 999u;    auto n2 = 999u;    unsigned int n = 0u;    unsigned int largest = 0;    for (; n1>=100; n2--)    {        if (n2 < 100)        {             n1--;             n2 = 999;             continue;         }        if (palindrom(n1*n2) == n1*n2)        {            cout << n1 <<  << n1 <<  n2  << n2 << endl;            cout << n1*n2;            if (largest < n1*n2)                largest = n1*n2;        }    }    cout << Largest << largest << endl;    return 0;}int palindrom(int num){    int new_num = 0;    int digit = 0;    while (num != 0)    {        digit = num % 10;        new_num = new_num*10 + digit;        num /= 10;    }    return new_num;}Output (project Euler solution kept secret) 906609
Project Euler #4 - Largest Palindrome Product
c++;c++11;programming challenge;palindrome
The way you've constructed your loop is awkward and hard to reason about.Why not just use a pair of nested loops?for(int i=100; i<1000; ++i) {    for(int j=i; j<1000; ++j) {        ...do stuff with (i,j)...    }}Don't use unsigned values unless you really need them.I'd make palindrome() into a boolean predicate personally:bool is_palindrome(int n) { ... }Don't recalculate the value of n1*n2 over and over again, assign it to a named variable and refer to that. It makes your code more readable & reduces the opportunity for errors to creep in.