c - Checking if Char contains numbers and converting it to INT -
This program is doing well, but I am trying to check it, if user entered Value is the number of letters or not signs) So basically I am using ifdigit or '/ 0' with condition. The program is compiled properly, but I'm getting the error when entering less than 3 types (even numbers ...) what's wrong in it? I need only one thing when the number is 0-999 and when it is not ask again, or this number is not, then loop is to be left.
char x [5]; Bool ijud; Int tab [20] [2], I = 0, A; Do {isgood = TRUE; Printf ("Write a where 0
Incorrect:
- < Li> Your Boolean-Logic
- Your Blank-Character
- Calling
atoi
whenisgood
isFALSE Change it:
isdigit (x [j]) == 0 || X [j]! = '/ 0'
To do this:
isdigit (x [j]) == 0 and ; Amp; X [j]! = '\ 0'
And this:
a = atoi (x); If break (a & lt; 1000 & isgood == true);
To do this:
if (isgood == true) {a = atoi (x); Break (0 & lt; a & amp; l & gt; 1000); }
There is a very easy way to do the whole thing:
int x; Four c; Do {printf ("Type where 0
Comments
Post a Comment