Could someone help in finding the error in the following code
Code:
#include<iostream.h>
#include<conio.h>
void main()
{
int choice,choiceexit,np,num,rev=0,digit;
do
{
cout<<"What do you want to check?\n1.Palindrome\n2.Armstrong No.\nPerfect No.\n";
cin>>choice;
if(choice==1)
{
cout<<"Enter your number \n";
cin>>num;
np=num;
while(num>0)
{
digit=num%10;
rev=(rev*10)+digit;
num=num/10;
}
cout<<"Reverse is "<<rev;
if(np==rev)
{
cout<<"\n It is a palindrome \n";
}
else if(np!=rev)
{
cout<<"\n It is not a palindrome \n";
}
cout<<"Do you want to continue?? (1=yes | 0=no)";
cin>>choiceexit;
}
} while(choiceexit!=0)
getch();
}
I am getting the error:
Do statement must have a while