Arithmetic/Integer: Difference between revisions
Content added Content deleted
Line 378: | Line 378: | ||
for str, f in ["+", ( + ); "-", ( - ); "*", ( * ); "/", ( / ); "%", ( % )] do |
for str, f in ["+", ( + ); "-", ( - ); "*", ( * ); "/", ( / ); "%", ( % )] do |
||
printf "%d %s %d = %d\n" a str b (f a b) |
printf "%d %s %d = %d\n" a str b (f a b) |
||
</lang> |
|||
For example, the output with the arguments 4 and 3 is: |
|||
<lang fsharp> |
|||
4 + 3 = 7 |
|||
4 - 3 = 1 |
|||
4 * 3 = 12 |
|||
4 / 3 = 1 |
|||
4 % 3 = 1 |
|||
</lang> |
</lang> |
||