added error code to div by 0
This commit is contained in:
parent
909d5353df
commit
ddc615456a
Binary file not shown.
|
@ -34,6 +34,7 @@ public class Calc {
|
||||||
int div2 = Integer.parseInt(num2);
|
int div2 = Integer.parseInt(num2);
|
||||||
if (div2 == 0 || div1 == 0){
|
if (div2 == 0 || div1 == 0){
|
||||||
print("cant divide by zero");
|
print("cant divide by zero");
|
||||||
|
print("error code:");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return div1 / div2;
|
return div1 / div2;
|
||||||
|
|
Loading…
Reference in New Issue