Arithmetic/Integer: Difference between revisions

m
→‎{{header|J}}: Add lang tags
m (→‎{{header|J}}: Add lang tags)
Line 410:
 
=={{header|J}}==
<lang j> calc =: + , - , * , <.@% , |~ , ^
labels =: >;.2 'Sum: Difference: Product: Quotient: Remainder: Exponentiation: '
combine =: [ ,. ":@|:@,:@]
bia =: labels combine calc
</lang>
 
Note that the verb <tt>calc</tt> produces all the processing specified for this problem, and that its output is of numeric type.
<lang j> 17 calc 3
20 14 51 5 2 4913
</lang>
 
Since other examples here provide textual output, <tt>bia</tt> produces like results.
 
<lang j> 17 bia 3
Sum: 20
Difference: 14
Product: 51
Quotient: 5
Remainder: 2
Exponentiation: 4913
</lang>
 
=={{header|Java}}==
892

edits