Hello! Yes this is for homework, but I only have a few teeny questions. Why, when I compile my program, does it give me three errors about end1 not being in iostream?? I know it is end(one) and not end(lowercase l).
But it still should work, right?
Also, how can I add a check to make sure the input is an integer and not, say, a letter?
Thanks for your help.
Code:
//Palidrome 2.29
#include <iostream>
int main()
{
using std::cout;
using std::cin;
using std::end1;
int integer; //user input
int digitOne, digitTwo, digitThree, digitFour, digitFive; //breaks up input
cout << "Enter a five-digit integer: "; //prompts user
cin >> integer; //place-holder for input
digitOne = integer / 10000;
digitTwo = integer % 10000 / 1000;
digitFour = integer % 10000 % 1000 % 100 / 10;
digitFive = integer % 10000 % 1000 % 10;
if (digitOne == digitFive && digitTwo == digitFour)
cout << integer << " is a palindrome." << end1;
else
cout << integer << " is not a palindrome." << end1;
return 0;
}