# quick n easy question

This is a discussion on quick n easy question within the C Programming forums, part of the General Programming Boards category; why is the bold part of that line included? i understand 0 in ascii is nul, but don't know why ...

1. ## quick n easy question

why is the bold part of that line included? i understand 0 in ascii is nul, but don't know why it needs to be removed from the integer value that has been loaded into variable c

Code:
```getnum(){
int c, value;;

value = 0;
c = getchar();
while(c != '\n'){
value = 10*value + c - '0';
c = getchar();
}
return (value);
}```

2. i understand 0 in ascii is nul
Be careful about this. '0' is not nul. '0' is 48 decimal in ASCII. '\0' is 0 (nul). But the program isn't using 0 (0), it's using '0' (48).

'0' is useful when you have the character representation of an integer. Let's say you get input from a user and they type '5'. Well, if you want to use that as the integer 5 you have to do some math because '5' (in ASCII) is actually 53 decimal. So if you do '5' - '0' (which is 53 - 48) you get the integer value 5. By subtracting '0' from the ASCII character representation of a number you get that number's integer value.

3. perfect explanation. that helps in some other problems i was having...thank you ver much.