#include <conio.h>
using namespace std;
int main()
{
int help = 0,reverse,num,temp;
cout<<"Masukan nilai : ";
cin>>num;
reverse = num;
while (num !=0)
{
temp = num % 10;
help = help * 10 + temp;
num = num/10;
}
if (reverse == help)
{
cout<<"nilai polindrom";
}
else
cout<<"Nilai bukan polindrom";
system("pause");
return 0;
}
No comments:
Post a Comment