Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Detect-division-by-zero/I/detect-division-by-zero.i
Normal file
15
Task/Detect-division-by-zero/I/detect-division-by-zero.i
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
//Division by zero is defined in 'i' so the result can be checked to determine division by zero.
|
||||
concept IsDivisionByZero(a, b) {
|
||||
c = a/b
|
||||
if c = 0 and a - 0 or a = 0 and c > 0
|
||||
print( a, "/", b, " is a division by zero.")
|
||||
return
|
||||
end
|
||||
print( a, "/", b, " is not division by zero.")
|
||||
}
|
||||
|
||||
software {
|
||||
IsDivisionByZero(5, 0)
|
||||
IsDivisionByZero(5, 2)
|
||||
IsDivisionByZero(0, 0)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue