Walk through your code in the debugger:
int gross; int net= gross - 20;
You need to initialize the
net
variable
after you've read the
gross
variable.
Once you've fixed that, you'll need to fix the
integer division[
^] in the rest of your code.
For example,
12 / 100
will be
0
, so
net = net - ((12 / 100) * gross)
equates to
net = net - (0 * gross)
, which is the same as
net = net
- you haven't changed the
"some random value minus 20" value at all.