Jump to content

Arithmetic/Integer: Difference between revisions

Line 378:
for str, f in ["+", ( + ); "-", ( - ); "*", ( * ); "/", ( / ); "%", ( % )] do
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>
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.