how would i stop a user from entering a letter when they should be entering a number?
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
usin namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
char nAns;
do{
int nPly1;
int nPly2;
int nPly3;
int nPly4;
int nPly5;
int nPly6;
int nMandril;
cout<< "this program calculates an O.D. for you\n\n";
cout<< " enter seven numbers:\n\n";
cout<< " ply 1 if no ply enter 0-:";
cin>>nPly1;
cout<<\n;
cout<<" ply 2 if no ply enter 0-:";
cin>> nPly2;
cout<<\n;
cout<< "ply 3 if no ply enter 0-:";
cin>>nPly3;
cout<<\n;
cout<< " ply 4 if no ply enter 0-:";
cin>> nPly4;
cout<<\n;
cout<< "ply 5 if no ply enter 0-:";
cin>> nPly5;
cout<<\n;
cout<< "ply 6 if no ply enter 0-:";
cin>>nPly6;
cout<<\n;
cout<<"mandril -:";
cin>>nMandril;
cout<<\n;
cout<<"outside diameter = ";
cout<< (nPly1+nPly2+nPly3+nPly4+nPly5+nPly6)*2+nMandril;
cout<<" do you want to do this again? (y/n)";
cin>>nAns;
}while(nAns=='y'||nAns=='Y');
}