how can we check to not enter the any string or char?
- From: "emre esirik(hacettepe computer science and engineering)" <emreesirik@xxxxxxxxx>
- Date: Wed, 31 Oct 2007 13:26:50 -0700
int n_mines;
printf("How many mines do you want in the minefield?");
scanf("%d", &n_mines);
while(n_mines>100 || n_mines<0)
{
printf("Please only enter between 1 and 100");
scanf("%d", &n_mines);
}
so I dont want to user can enter the string or char value,how can I
check it?
.
- Follow-Ups:
- Re: how can we check to not enter the any string or char?
- From: santosh
- Re: how can we check to not enter the any string or char?
- From: John Gordon
- Re: how can we check to not enter the any string or char?
- Prev by Date: Re: The most important things to write a program
- Next by Date: Re: how can we check to not enter the any string or char?
- Previous by thread: nested structures and initialization
- Next by thread: Re: how can we check to not enter the any string or char?
- Index(es):
Relevant Pages
|