#include <iostream>
using namespace std;
int main ()
{
int num;
cout<<"Enter a number:";
cin>>num;
return 0;
}
when i enter "a" it will be popping out of the screen. how do i solve it by repeating the "Enter a number" to continue requesting people to enter the data???
Calling main is forbidden by the standard, and if cin.fail returns true, you don't remove the offending input from the stream so you end up with an endless recursive cycle.