I need to write code which would get out 6 palindrome numbers on screen.
Example: 300003 310013 320023 330033 340043 350053.
Findings: So far I have just written code how to check if its palindrome number or not.
Here is code for how i check if its palindrome or not:
#include <iostream>
using namespace std;
int main()
{
int n, num, dig, rev = 0;
cout << "Insert number": "<< endl;
cin >> num;
n = num;
while (num != 0);
{
dig = num % 10;
rev = (rev * 10) + dig;
num = num / 10;
}
if (n == rev)
cout << "This is palindrome "<< rev << endl;
else
cout << "This is not palindrome "<< rev << endl;
return 0;
}
Can you guys give some ideas how I can do that?